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

Miklos Vajna vmiklos at collabora.co.uk
Mon Mar 31 08:15:50 PDT 2014


 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |    3 ---
 sw/qa/extras/rtfexport/rtfexport.cxx     |    3 ---
 sw/source/filter/ww8/ww8atr.cxx          |   15 ++++++++-------
 3 files changed, 8 insertions(+), 13 deletions(-)

New commits:
commit 84c40768f8acb0342dcfa223133497f57620fc14
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Mar 31 17:01:03 2014 +0200

    MSWordExportBase::OutputItemSet: handle fill attributes as frame ones
    
    Fill attributes with their original WhichId are only used for frames at
    the moment, replacing RES_BACKGROUND. To keep export filters working,
    handle those fill attributes as frame ones as well.
    
    Change-Id: I1e59b483b706d9fd3f9b947e83244740e3293f9e

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 2b068ad..77e8370 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -645,15 +645,12 @@ DECLARE_OOXMLEXPORT_TEST(testFdo64826, "fdo64826.docx")
     CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<sal_Bool>(mxComponent, "RecordChanges")));
 }
 
-#if 0
-// FIXME port to FillAttributes
 DECLARE_OOXMLEXPORT_TEST(testPageBackground, "page-background.docx")
 {
     // 'Document Background' wasn't exported.
     uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
     CPPUNIT_ASSERT_EQUAL(sal_Int32(0x92D050), getProperty<sal_Int32>(xPageStyle, "BackColor"));
 }
-#endif
 
 DECLARE_OOXMLEXPORT_TEST(testPageGraphicBackground, "page-graphic-background.odt")
 {
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 4b409ad..0aba10b 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -476,8 +476,6 @@ DECLARE_RTFEXPORT_TEST(testTextFrameBorders, "textframe-borders.rtf")
     CPPUNIT_ASSERT_EQUAL(sal_Int32(0x622423), aShadowFormat.Color);
 }
 
-#if 0
-// FIXME port to FillAttributes
 DECLARE_RTFEXPORT_TEST(testTextframeGradient, "textframe-gradient.rtf")
 {
     uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
@@ -498,7 +496,6 @@ DECLARE_RTFEXPORT_TEST(testTextframeGradient, "textframe-gradient.rtf")
     CPPUNIT_ASSERT_EQUAL(sal_Int32(0x666666), aGradient.EndColor);
     CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_AXIAL, aGradient.Style);
 }
-#endif
 
 DECLARE_RTFEXPORT_TEST(testRecordChanges, "record-changes.rtf")
 {
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 2ae3c5d..bf92692 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -296,7 +296,9 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool
             {
                 pItem = aI->second;
                 sal_uInt16 nWhich = pItem->Which();
-                if ( nWhich >= RES_PARATR_BEGIN && nWhich < RES_FRMATR_END && nWhich != RES_PARATR_NUMRULE)
+                // Handle fill attributes just like frame attributes for now.
+                if ( (nWhich >= RES_PARATR_BEGIN && nWhich < RES_FRMATR_END && nWhich != RES_PARATR_NUMRULE ) ||
+                     (nWhich >= XATTR_FILL_FIRST && nWhich < XATTR_FILL_LAST))
                     AttrOutput().OutputItem( *pItem );
             }
         }
@@ -811,7 +813,9 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF
                 const SwFrmFmt &rFrmFmt = mpParentFrame->GetFrmFmt();
 
                 SfxItemSet aSet(pDoc->GetAttrPool(), RES_FRMATR_BEGIN,
-                    RES_FRMATR_END-1);
+                    RES_FRMATR_END-1,
+                    XATTR_FILL_FIRST, XATTR_FILL_LAST,
+                    0);
                 aSet.Set(rFrmFmt.GetAttrSet());
 
                 // Fly als Zeichen werden bei uns zu Absatz-gebundenen
@@ -5365,15 +5369,12 @@ void AttributeOutputBase::OutputItem( const SfxPoolItem& rHt )
         case RES_BACKGROUND:
             FormatBackground( static_cast< const SvxBrushItem& >( rHt ) );
             break;
-#if 0
-        // FIXME port to FillAttributes
-        case RES_FILL_STYLE:
+        case XATTR_FILLSTYLE:
             FormatFillStyle( static_cast< const XFillStyleItem& >( rHt ) );
             break;
-        case RES_FILL_GRADIENT:
+        case XATTR_FILLGRADIENT:
             FormatFillGradient( static_cast< const XFillGradientItem& >( rHt ) );
             break;
-#endif
         case RES_BOX:
             FormatBox( static_cast< const SvxBoxItem& >( rHt ) );
             break;


More information about the Libreoffice-commits mailing list