[Libreoffice-commits] core.git: 3 commits - sw/qa sw/source

Caolán McNamara caolanm at redhat.com
Tue Aug 25 08:54:32 PDT 2015


 sw/qa/core/data/ww5/pass/crash-2.doc |binary
 sw/source/filter/ww8/ww8glsy.cxx     |   10 ++++------
 sw/source/filter/ww8/ww8par.cxx      |   27 ++++++++++++++++-----------
 sw/source/filter/ww8/ww8par.hxx      |    8 ++++----
 4 files changed, 24 insertions(+), 21 deletions(-)

New commits:
commit 5da016f5e78f7f36136a8179e152aa14aee3d187
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Aug 25 12:22:31 2015 +0100

    Revert "disable test case pending index assert fix"
    
    This reverts commit af9751a760e9007d0450adf2753d8a65be5f536c.

diff --git a/sw/qa/core/data/ww5/pass/crash-2.doc b/sw/qa/core/data/ww5/pass/crash-2.doc
new file mode 100644
index 0000000..23a1897
Binary files /dev/null and b/sw/qa/core/data/ww5/pass/crash-2.doc differ
commit d9edac5d58aa3c4f15cf4022a1faf776d3003e78
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Aug 25 16:36:08 2015 +0100

    behave like the native format filter for non-insert mode
    
    just shove the unneeded pam into dead space
    
    Change-Id: Id0a3d550cd9d54394888e6b2d62e21eaded24a7c

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 45f84d4..00318f2 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -6153,6 +6153,10 @@ sal_uLong WW8Reader::Read(SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, co
         {
             // Remove Frame and offsets from Frame Template
             Reader::ResetFrameFormats( rDoc );
+
+            rPaM.GetBound().nContent.Assign(0, 0);
+            rPaM.GetBound(false).nContent.Assign(0, 0);
+
         }
         try
         {
commit 3d992d77d8ae319b31dca808e8c08f439a1bc9c3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Aug 25 13:30:12 2015 +0100

    we only need the PaM for its Point and only to create a uno cursor
    
    so do that in the ctor and drop the arg from a bunch of places
    
    Change-Id: Iaad71e9854b38d8632df057dfe9c96468d1d0098

diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx
index 7a8d0f4..f125f69 100644
--- a/sw/source/filter/ww8/ww8glsy.cxx
+++ b/sw/source/filter/ww8/ww8glsy.cxx
@@ -210,8 +210,6 @@ bool WW8Glossary::Load( SwTextBlocks &rBlocks, bool bSaveRelFile )
             if (xDocSh->DoInitNew(0))
             {
                 SwDoc *pD =  static_cast<SwDocShell*>((&xDocSh))->GetDoc();
-                SwWW8ImplReader* pRdr = new SwWW8ImplReader(pGlossary->nVersion,
-                    xStg, &rStrm, *pD, rBlocks.GetBaseURL(), true, false);
 
                 SwNodeIndex aIdx(
                     *pD->GetNodes().GetEndOfContent().StartOfSectionNode(), 1);
@@ -223,11 +221,11 @@ bool WW8Glossary::Load( SwTextBlocks &rBlocks, bool bSaveRelFile )
                 SwPaM aPamo( aIdx );
                 aPamo.GetPoint()->nContent.Assign(aIdx.GetNode().GetContentNode(),
                     0);
-                pRdr->LoadDoc(aPamo,this);
-
+                std::unique_ptr<SwWW8ImplReader> xRdr(new SwWW8ImplReader(
+                    pGlossary->nVersion, xStg, &rStrm, *pD, rBlocks.GetBaseURL(),
+                    true, false, *aPamo.GetPoint()));
+                xRdr->LoadDoc(this);
                 bRet = MakeEntries(pD, rBlocks, bSaveRelFile, aStrings, aData);
-
-                delete pRdr;
             }
             xDocSh->DoClose();
             rBlocks.EndPutMuchBlockEntries();
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index d7eadb1..45f84d4 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4124,7 +4124,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType)
 }
 
 SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SotStorage* pStorage,
-    SvStream* pSt, SwDoc& rD, const OUString& rBaseURL, bool bNewDoc, bool bSkipImages)
+    SvStream* pSt, SwDoc& rD, const OUString& rBaseURL, bool bNewDoc, bool bSkipImages, SwPosition &rPos)
     : m_pDocShell(rD.GetDocShell())
     , m_pStg(pStorage)
     , m_pStrm(pSt)
@@ -4260,6 +4260,8 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SotStorage* pStorage,
 {
     m_pStrm->SetEndian( SvStreamEndian::LITTLE );
     m_aApos.push_back(false);
+
+    mpCrsr = m_rDoc.CreateUnoCrsr(rPos);
 }
 
 void SwWW8ImplReader::DeleteStk(SwFltControlStack* pStck)
@@ -4881,7 +4883,7 @@ bool SwWW8ImplReader::ReadGlobalTemplateSettings( const OUString& sCreatedFrom,
     return bRes;
 }
 
-sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
+sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss)
 {
     sal_uLong nErrRet = 0;
 
@@ -4917,7 +4919,6 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
             pDocShell->SetReadOnlyUI();
     }
 
-    mpCrsr = m_rDoc.CreateUnoCrsr(rPos);
     m_pPaM = mpCrsr.get();
 
     m_pCtrlStck = new SwWW8FltControlStack( &m_rDoc, m_nFieldFlags, *this );
@@ -5595,7 +5596,7 @@ namespace
     }
 }
 
-sal_uLong SwWW8ImplReader::LoadThroughDecryption(SwPaM& rPaM ,WW8Glossary *pGloss)
+sal_uLong SwWW8ImplReader::LoadThroughDecryption(WW8Glossary *pGloss)
 {
     sal_uLong nErrRet = 0;
     if (pGloss)
@@ -5765,7 +5766,7 @@ sal_uLong SwWW8ImplReader::LoadThroughDecryption(SwPaM& rPaM ,WW8Glossary *pGlos
     }
 
     if (!nErrRet)
-        nErrRet = CoreLoad(pGloss, *rPaM.GetPoint());
+        nErrRet = CoreLoad(pGloss);
 
     delete pTempMain;
     delete pTempTable;
@@ -5962,7 +5963,7 @@ const OUString* SwWW8ImplReader::GetAnnotationAuthor(sal_uInt16 nIdx)
     return pRet;
 }
 
-sal_uLong SwWW8ImplReader::LoadDoc( SwPaM& rPaM,WW8Glossary *pGloss)
+sal_uLong SwWW8ImplReader::LoadDoc(WW8Glossary *pGloss)
 {
     sal_uLong nErrRet = 0;
 
@@ -6037,7 +6038,7 @@ sal_uLong SwWW8ImplReader::LoadDoc( SwPaM& rPaM,WW8Glossary *pGloss)
     }
 
     if (!nErrRet)
-        nErrRet = LoadThroughDecryption(rPaM ,pGloss);
+        nErrRet = LoadThroughDecryption(pGloss);
 
     m_rDoc.PropagateOutlineRule();
 
@@ -6103,7 +6104,7 @@ sal_uLong WW8Reader::OpenMainStream( tools::SvRef<SotStorageStream>& rRef, sal_u
     return nRet;
 }
 
-sal_uLong WW8Reader::Read(SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPam, const OUString & /* FileName */)
+sal_uLong WW8Reader::Read(SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, const OUString & /* FileName */)
 {
     sal_uInt16 nOldBuffSize = 32768;
     bool bNew = !bInsertMode; // New Doc (no inserting)
@@ -6146,16 +6147,16 @@ sal_uLong WW8Reader::Read(SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPam, co
 
     if( !nRet )
     {
+        SwWW8ImplReader* pRdr = new SwWW8ImplReader(nVersion, pStg, pIn, rDoc,
+            rBaseURL, bNew, bSkipImages, *rPaM.GetPoint());
         if (bNew)
         {
             // Remove Frame and offsets from Frame Template
             Reader::ResetFrameFormats( rDoc );
         }
-        SwWW8ImplReader* pRdr = new SwWW8ImplReader(nVersion, pStg, pIn, rDoc,
-            rBaseURL, bNew, bSkipImages);
         try
         {
-            nRet = pRdr->LoadDoc( rPam );
+            nRet = pRdr->LoadDoc();
         }
         catch( const std::exception& )
         {
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 79949ed..84541fd 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1532,9 +1532,9 @@ private:
     //This converts MS Asian Typography information into OOo's
     void ImportDopTypography(const WW8DopTypography &rTypo);
 
-    sal_uLong LoadThroughDecryption(SwPaM& rPaM ,WW8Glossary *pGloss);
+    sal_uLong LoadThroughDecryption(WW8Glossary *pGloss);
     sal_uLong SetSubStreams(tools::SvRef<SotStorageStream> &rTableStream, tools::SvRef<SotStorageStream> &rDataStream);
-    sal_uLong CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos);
+    sal_uLong CoreLoad(WW8Glossary *pGloss);
 
     void ReadDocVars();
 
@@ -1879,11 +1879,11 @@ public:     // really private, but can only be done public
     static ColorData GetCol(sal_uInt8 nIco);
 
     SwWW8ImplReader( sal_uInt8 nVersionPara, SotStorage* pStorage, SvStream* pSt,
-        SwDoc& rD, const OUString& rBaseURL, bool bNewDoc, bool bSkipImages );
+        SwDoc& rD, const OUString& rBaseURL, bool bNewDoc, bool bSkipImages, SwPosition &rPos );
 
     const OUString& GetBaseURL() const { return m_sBaseURL; }
     // load a complete doc file
-    sal_uLong LoadDoc( SwPaM&,WW8Glossary *pGloss=0);
+    sal_uLong LoadDoc(WW8Glossary *pGloss=0);
     rtl_TextEncoding GetCurrentCharSet();
     rtl_TextEncoding GetCurrentCJKCharSet();
     rtl_TextEncoding GetCharSetFromLanguage();


More information about the Libreoffice-commits mailing list