[Libreoffice-commits] core.git: 2 commits - include/xmloff sw/qa sw/source

Miklos Vajna vmiklos at collabora.co.uk
Thu Jan 9 09:22:45 PST 2014


 include/xmloff/odffields.hxx                 |    1 
 sw/qa/core/uwriter.cxx                       |   42 ---------------------------
 sw/source/core/crsr/pam.cxx                  |   15 ---------
 sw/source/core/crsr/swcrsr.cxx               |    5 +--
 sw/source/filter/ww8/attributeoutputbase.hxx |    6 ---
 sw/source/filter/ww8/docxattributeoutput.cxx |    8 -----
 sw/source/filter/ww8/docxattributeoutput.hxx |    4 --
 sw/source/filter/ww8/rtfattributeoutput.cxx  |    8 -----
 sw/source/filter/ww8/rtfattributeoutput.hxx  |    4 --
 sw/source/filter/ww8/wrtw8nds.cxx            |   18 +----------
 sw/source/filter/ww8/ww8atr.cxx              |    4 --
 sw/source/filter/ww8/ww8attributeoutput.hxx  |    2 -
 12 files changed, 6 insertions(+), 111 deletions(-)

New commits:
commit fc561bcdf754656a1879c7d78aceafbb0ea7a305
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jan 9 18:18:11 2014 +0100

    xmloff: unused define
    
    Change-Id: I77d072b3b6b9b7d86e6279a5cae3d96a21827eb2

diff --git a/include/xmloff/odffields.hxx b/include/xmloff/odffields.hxx
index 98d9c9d..1a4bb2b 100644
--- a/include/xmloff/odffields.hxx
+++ b/include/xmloff/odffields.hxx
@@ -42,7 +42,6 @@
 #define ODF_OLE_PARAM "vnd.oasis.opendocument.field.ole"
 #define ODF_ID_PARAM "vnd.oasis.opendocument.field.id"
 #define ODF_CODE_PARAM "vnd.oasis.opendocument.field.code"
-#define ODF_COMMENTRANGE "vnd.oasis.opendocument.field.COMMENTRANGE"
 
 #endif // INCLUDED_XMLOFF_ODFFIELDS_HXX
 
commit 0de00e2782493e8cf78710c40c98ca57b227244a
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jan 9 18:01:08 2014 +0100

    sw: remove references to ODF_COMMENTRANGE
    
    Fieldmarks of type ODF_COMMENTRANGE are no longer used, since we got
    annotation marks.
    
    Also remove two unit tests: they tested problems which are no longer
    possible by design (commented text ranges are no longer fieldmarks, and
    there is a single placeholder character for them, instead of 3).
    
    Change-Id: I14bf144c436329d2aa8c48493e5ad87db862cceb

diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 3a7a8d4..e5110d4 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -73,8 +73,6 @@ public:
     void testSwScanner();
     void testUserPerceivedCharCount();
     void testGraphicAnchorDeletion();
-    void testFdo57938();
-    void testFdo59573();
     void testTransliterate();
 
     CPPUNIT_TEST_SUITE(SwDocTest);
@@ -87,8 +85,6 @@ public:
     CPPUNIT_TEST(testSwScanner);
     CPPUNIT_TEST(testUserPerceivedCharCount);
     CPPUNIT_TEST(testGraphicAnchorDeletion);
-    CPPUNIT_TEST(testFdo57938);
-    CPPUNIT_TEST(testFdo59573);
     CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -855,44 +851,6 @@ void SwDocTest::randomTest()
     }
 }
 
-void SwDocTest::testFdo57938()
-{
-    SwNodeIndex aIdx(m_pDoc->GetNodes().GetEndOfContent(), -1);
-    SwPaM aPaM(aIdx);
-
-    // Insert "atest" and create a fieldmark around "test".
-    OUString aTest("atest");
-    m_pDoc->InsertString(aPaM, aTest);
-    aPaM.SetMark();
-    aPaM.GetPoint()->nContent = 1;
-    IDocumentMarkAccess* pMarksAccess = m_pDoc->getIDocumentMarkAccess();
-    pMarksAccess->makeFieldBookmark(aPaM, "", ODF_COMMENTRANGE);
-    aPaM.GetPoint()->nContent = 0;
-    aPaM.GetMark()->nContent = 1;
-    // The problem was that "a" was considered read-only, so could not be deleted.
-    CPPUNIT_ASSERT_EQUAL(false, aPaM.HasReadonlySel(false));
-}
-
-void SwDocTest::testFdo59573()
-{
-    SwNodeIndex aIdx(m_pDoc->GetNodes().GetEndOfContent(), -1);
-    SwPaM aPaM(aIdx);
-
-    // Insert "abc" and create a fieldmark around "b".
-    OUString aTest("abc");
-    m_pDoc->InsertString(aPaM, aTest);
-    aPaM.SetMark();
-    aPaM.GetPoint()->nContent = 1;
-    aPaM.GetMark()->nContent = 2;
-    IDocumentMarkAccess* pMarksAccess = m_pDoc->getIDocumentMarkAccess();
-    pMarksAccess->makeFieldBookmark(aPaM, "", ODF_COMMENTRANGE);
-    aPaM.GetPoint()->nContent = 4;
-    aPaM.GetMark()->nContent = 4;
-    // The problem was that the position after the fieldmark end and before the
-    // annotation anchor wasn't read-only.
-    CPPUNIT_ASSERT_EQUAL(true, aPaM.HasReadonlySel(false));
-}
-
 static OUString
 translitTest(SwDoc & rDoc, SwPaM & rPaM, sal_uInt32 const nType)
 {
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 0eaccbe..cb78314 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -665,7 +665,6 @@ bool SwPaM::HasReadonlySel( bool bFormView, bool bAnnotationMode ) const
     sw::mark::IMark* pA = NULL;
     sw::mark::IMark* pB = NULL;
     bool bUnhandledMark = false;
-    bool bCommentrangeMark = false;
     const IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess();
     if ( pDoc )
     {
@@ -674,18 +673,7 @@ bool SwPaM::HasReadonlySel( bool bFormView, bool bAnnotationMode ) const
 
         sw::mark::IFieldmark* pFieldmark = pMarksAccess->getFieldmarkFor( *GetPoint() );
         if ( pFieldmark )
-        {
             bUnhandledMark = pFieldmark->GetFieldname( ) == ODF_UNHANDLED;
-            if (!bUnhandledMark)
-                bCommentrangeMark = pFieldmark->GetFieldname() == ODF_COMMENTRANGE;
-        }
-        // Allow editing selection right before a commented range.
-        if (!bCommentrangeMark && GetMark())
-        {
-            pFieldmark = pMarksAccess->getFieldmarkFor(*GetMark());
-            if (pFieldmark)
-                bCommentrangeMark = pFieldmark->GetFieldname() == ODF_COMMENTRANGE;
-        }
     }
 
     if (!bRet)
@@ -693,8 +681,7 @@ bool SwPaM::HasReadonlySel( bool bFormView, bool bAnnotationMode ) const
         // Unhandled fieldmarks case shouldn't be edited manually to avoid breaking anything
         if ( ( pA == pB ) && bUnhandledMark )
             bRet = true;
-        // Allow editing of commented ranges.
-        else if (!bCommentrangeMark)
+        else
         {
             // Form protection case
             bool bAtStartA = pA != NULL && pA->GetMarkStart() == *GetPoint();
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 014a006..20e3655 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -48,7 +48,6 @@
 #include <mdiexp.hxx>
 #include <statstr.hrc>
 #include <redline.hxx>
-#include <xmloff/odffields.hxx>
 #include <txatbase.hxx>
 
 using namespace ::com::sun::star::i18n;
@@ -1340,8 +1339,8 @@ sal_Bool SwCursor::SelectWordWT( SwViewShell* pViewShell, sal_Int16 nWordType, c
     {
         // Should we select the whole fieldmark?
         const IDocumentMarkAccess* pMarksAccess = GetDoc()->getIDocumentMarkAccess( );
-        sw::mark::IFieldmark* pMark = GetPoint() ? pMarksAccess->getFieldmarkFor( *GetPoint( ) ) : NULL;
-        if ( pMark && pMark->GetFieldname() != ODF_COMMENTRANGE )
+        sw::mark::IMark* pMark = GetPoint() ? pMarksAccess->getFieldmarkFor( *GetPoint( ) ) : NULL;
+        if ( pMark )
         {
             const SwPosition rStart = pMark->GetMarkStart();
             GetPoint()->nNode = rStart.nNode;
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx
index 6ae14af..8ed93db 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -187,12 +187,6 @@ public:
     /// for docx w:commentReference
     virtual void WritePostitFieldReference() {};
 
-    /// for docx w:commentRangeStart
-    virtual void WritePostitFieldStart() {};
-
-    /// for docx w:commentRangeEnd
-    virtual void WritePostitFieldEnd() {};
-
     /// Output text (inside a run).
     virtual void RunText( const OUString& rText, rtl_TextEncoding eCharSet ) = 0;
 
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index f992e5b..84ffa58 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4657,14 +4657,6 @@ void DocxAttributeOutput::WritePostitFieldReference()
     }
 }
 
-void DocxAttributeOutput::WritePostitFieldStart()
-{
-}
-
-void DocxAttributeOutput::WritePostitFieldEnd()
-{
-}
-
 void DocxAttributeOutput::WritePostitFields()
 {
     for( unsigned int i = 0;
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 69258b9..9d55df6 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -161,10 +161,6 @@ public:
 
     virtual void WritePostitFieldReference();
 
-    virtual void WritePostitFieldStart();
-
-    virtual void WritePostitFieldEnd();
-
     /// Output text (inside a run).
     virtual void RunText( const OUString& rText, rtl_TextEncoding eCharSet = RTL_TEXTENCODING_UTF8 );
 
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 06939ff..4df549c 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -3255,14 +3255,6 @@ void RtfAttributeOutput::PostitField( const SwField* pFld )
     m_aRunText->append('}');
 }
 
-void RtfAttributeOutput::WritePostitFieldStart()
-{
-}
-
-void RtfAttributeOutput::WritePostitFieldEnd()
-{
-}
-
 bool RtfAttributeOutput::DropdownField( const SwField* /*pFld*/ )
 {
     // this is handled in OutputFlyFrame_Impl()
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx
index d7ce5c8..5a35881 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.hxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -71,10 +71,6 @@ public:
     /// Called after we end outputting the attributes.
     virtual void EndRunProperties( const SwRedlineData* pRedlineData );
 
-    virtual void WritePostitFieldStart() SAL_OVERRIDE;
-
-    virtual void WritePostitFieldEnd() SAL_OVERRIDE;
-
     /// Output text (inside a run).
     virtual void RunText( const OUString& rText, rtl_TextEncoding eCharSet = RTL_TEXTENCODING_UTF8 );
 
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 9d4818b..d641cbe 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1706,10 +1706,6 @@ bool MSWordExportBase::GetBookmarks( const SwTxtNode& rNd, sal_Int32 nStt,
             bool bIsStartOk = ( pMark->GetMarkStart().nNode == nNd ) && ( nBStart >= nStt ) && ( nBStart <= nEnd );
             bool bIsEndOk = ( pMark->GetMarkEnd().nNode == nNd ) && ( nBEnd >= nStt ) && ( nBEnd <= nEnd );
 
-            IFieldmark* pFieldmark = dynamic_cast<IFieldmark*>(pMark);
-            if (pFieldmark && pFieldmark->GetFieldname() == ODF_COMMENTRANGE)
-                continue;
-
             if ( bIsStartOk || bIsEndOk )
             {
                 rArr.push_back( pMark );
@@ -2030,18 +2026,13 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
                     }
                 }
 
-                bool bCommentRange = pFieldmark && pFieldmark->GetFieldname() == ODF_COMMENTRANGE;
-                if (bCommentRange)
-                    AttrOutput().WritePostitFieldStart();
-                else
-                    OutputField( NULL, eFieldId, sCode, WRITEFIELD_START | WRITEFIELD_CMD_START );
+                OutputField( NULL, eFieldId, sCode, WRITEFIELD_START | WRITEFIELD_CMD_START );
 
                 if ( pFieldmark && pFieldmark->GetFieldname( ) == ODF_FORMTEXT )
                     WriteFormData( *pFieldmark );
                 else if ( pFieldmark && pFieldmark->GetFieldname( ) == ODF_HYPERLINK )
                     WriteHyperlinkData( *pFieldmark );
-                if (!bCommentRange)
-                    OutputField( NULL, lcl_getFieldId( pFieldmark ), OUString(), WRITEFIELD_CMD_END );
+                OutputField( NULL, lcl_getFieldId( pFieldmark ), OUString(), WRITEFIELD_CMD_END );
 
                 if ( pFieldmark && pFieldmark->GetFieldname() == ODF_UNHANDLED )
                 {
@@ -2076,10 +2067,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
                     }
                 }
 
-                if (pFieldmark && pFieldmark->GetFieldname() == ODF_COMMENTRANGE)
-                    AttrOutput().WritePostitFieldEnd();
-                else
-                    OutputField( NULL, eFieldId, OUString(), WRITEFIELD_CLOSE );
+                OutputField( NULL, eFieldId, OUString(), WRITEFIELD_CLOSE );
 
                 if ( pFieldmark && pFieldmark->GetFieldname() == ODF_FORMTEXT )
                     AppendBookmark( pFieldmark->GetName(), false );
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 418d20d..4a800b1 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2488,10 +2488,6 @@ void WW8AttributeOutput::PostitField( const SwField* pFld )
     m_rWW8Export.WritePostItBegin( m_rWW8Export.pO );
 }
 
-void WW8AttributeOutput::WritePostitFieldStart()
-{
-}
-
 bool WW8AttributeOutput::DropdownField( const SwField* pFld )
 {
     bool bExpand = true;
diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx
index 924060b..48e1e48 100644
--- a/sw/source/filter/ww8/ww8attributeoutput.hxx
+++ b/sw/source/filter/ww8/ww8attributeoutput.hxx
@@ -418,8 +418,6 @@ protected:
     virtual bool DropdownField( const SwField* pFld );
     virtual bool PlaceholderField( const SwField* pFld );
 
-    virtual void WritePostitFieldStart();
-
     virtual bool AnalyzeURL( const OUString& rURL, const OUString& rTarget, OUString* pLinkURL, OUString* pMark );
 
     /// Reference to the export, where to get the data from


More information about the Libreoffice-commits mailing list