[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/qa sw/source
Caolán McNamara
caolanm at redhat.com
Fri Aug 21 08:09:07 PDT 2015
sw/qa/core/data/ww6/pass/crash-2.doc |binary
sw/source/filter/ww8/ww8graf.cxx | 15 ++++++++-------
sw/source/filter/ww8/ww8par.hxx | 2 +-
3 files changed, 9 insertions(+), 8 deletions(-)
New commits:
commit 0eca0a5e5d0413aaf5d40b34ddb271971ce61de5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 21 11:27:06 2015 +0100
if read string was truncated, then truncate attributes range to match
Change-Id: I3501d31e0310481a5872e537bf53ad2faaf25779
(cherry picked from commit 6071feec26743dacff1060658e57d5cf62cde2a8)
Reviewed-on: https://gerrit.libreoffice.org/17907
Reviewed-by: David Tardon <dtardon at redhat.com>
Tested-by: David Tardon <dtardon at redhat.com>
diff --git a/sw/qa/core/data/ww6/pass/crash-2.doc b/sw/qa/core/data/ww6/pass/crash-2.doc
new file mode 100644
index 0000000..f155e97
Binary files /dev/null and b/sw/qa/core/data/ww6/pass/crash-2.doc differ
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index de2c3d0..6d5ee95 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -865,7 +865,7 @@ bool SwWW8ImplReader::GetTxbxTextSttEndCp(WW8_CP& rStartCp, WW8_CP& rEndCp,
// TxbxText() holt aus WW-File den Text und gibt diesen und den Anfangs- und
// den um -2 (bzw. -1 bei Ver8) korrigierten End-Cp zurueck
-bool SwWW8ImplReader::GetRangeAsDrawingString(OUString& rString, long nStartCp, long nEndCp, ManTypes eType)
+sal_Int32 SwWW8ImplReader::GetRangeAsDrawingString(OUString& rString, long nStartCp, long nEndCp, ManTypes eType)
{
WW8_CP nOffset = m_pWwFib->GetBaseCp(eType);
@@ -884,23 +884,24 @@ bool SwWW8ImplReader::GetRangeAsDrawingString(OUString& rString, long nStartCp,
rString = rString.copy(0, nLen-1);
rString = rString.replace( 0xb, 0xa );
- return true;
+ return nLen;
}
}
- return false;
+ return 0;
}
OutlinerParaObject* SwWW8ImplReader::ImportAsOutliner(OUString &rString, WW8_CP nStartCp, WW8_CP nEndCp, ManTypes eType)
{
OutlinerParaObject* pRet = 0;
- if (GetRangeAsDrawingString( rString, nStartCp, nEndCp, eType ))
+ sal_Int32 nLen = GetRangeAsDrawingString(rString, nStartCp, nEndCp, eType);
+ if (nLen > 0)
{
if (!m_pDrawEditEngine)
m_pDrawEditEngine = new EditEngine(0);
m_pDrawEditEngine->SetText(rString);
- InsertAttrsAsDrawingAttrs(nStartCp, nEndCp, eType);
+ InsertAttrsAsDrawingAttrs(nStartCp, nStartCp+nLen, eType);
// Annotations typically begin with a (useless) 0x5
if ((eType == MAN_AND) && m_pDrawEditEngine->GetTextLen())
@@ -950,8 +951,8 @@ SwFrameFormat* SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj,
OUString aString;
WW8_CP nStartCp, nEndCp;
bool bContainsGraphics = false;
- bool bTextWasRead = GetTxbxTextSttEndCp( nStartCp, nEndCp, nTxBxS,
- nSequence ) && GetRangeAsDrawingString( aString, nStartCp, nEndCp, eType );
+ bool bTextWasRead = GetTxbxTextSttEndCp(nStartCp, nEndCp, nTxBxS, nSequence) &&
+ GetRangeAsDrawingString(aString, nStartCp, nEndCp, eType) > 0;
if (!m_pDrawEditEngine)
m_pDrawEditEngine = new EditEngine(0);
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 8a130a1..e53eb76 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1585,7 +1585,7 @@ private:
bool GetTxbxTextSttEndCp(WW8_CP& rStartCp, WW8_CP& rEndCp, sal_uInt16 nTxBxS,
sal_uInt16 nSequence);
- bool GetRangeAsDrawingString(OUString& rString, long StartCp, long nEndCp, ManTypes eType);
+ sal_Int32 GetRangeAsDrawingString(OUString& rString, long StartCp, long nEndCp, ManTypes eType);
OutlinerParaObject* ImportAsOutliner(OUString &rString, WW8_CP nStartCp, WW8_CP nEndCp, ManTypes eType);
SwFrameFormat* InsertTxbxText(SdrTextObj* pTextObj, Size* pObjSiz,
sal_uInt16 nTxBxS, sal_uInt16 nSequence, long nPosCp, SwFrameFormat* pFlyFormat,
More information about the Libreoffice-commits
mailing list