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

Miklos Vajna vmiklos at collabora.co.uk
Mon Dec 9 00:48:34 PST 2013


 sw/qa/extras/rtfexport/data/abi10201.rtf    |    3 +++
 sw/qa/extras/rtfexport/rtfexport.cxx        |    5 +++++
 sw/source/filter/ww8/rtfattributeoutput.cxx |    9 ++++++---
 sw/source/filter/ww8/rtfexport.hxx          |    4 ----
 4 files changed, 14 insertions(+), 7 deletions(-)

New commits:
commit bc78c61bd29b1eac4ef70bfbcc67b4b49e16ccdd
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Dec 9 09:40:46 2013 +0100

    RTF export: unused forward declaration
    
    Change-Id: Ida8e4d9e9b6ea7e1009b8cf617363d31e895a5a2

diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx
index 886322f..20b4c01 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -33,10 +33,6 @@ class SwTxtNode;
 class SwGrfNode;
 class SwOLENode;
 
-namespace com { namespace sun { namespace star {
-    namespace frame { class XModel; }
-} } }
-
 /// The class that does all the actual RTF export-related work.
 class RtfExport : public MSWordExportBase
 {
commit 1cc1a893763c948f20463b808ea5eabe10eb7fd5
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Dec 9 09:40:14 2013 +0100

    abi#10201 RTF export: fix crash when handling table::BorderLineStyle::NONE
    
    Change-Id: I811820c0d550ce24ad2180a8917ef0087968c30b

diff --git a/sw/qa/extras/rtfexport/data/abi10201.rtf b/sw/qa/extras/rtfexport/data/abi10201.rtf
new file mode 100644
index 0000000..08cbe0c
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/abi10201.rtf
@@ -0,0 +1,3 @@
+{\rtf1
+{\*\do\dobxpage\dobypara\dodhgt8192\dptxbx\dptxbxmar0\dpx2914\dpy5119\dpxsize6474\dpysize221\dplinehollow0}
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index b6084cb..f04e315 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -579,6 +579,11 @@ DECLARE_RTFEXPORT_TEST(testFdo66743, "fdo66743.rtf")
     CPPUNIT_ASSERT_EQUAL(sal_Int32(0xd8d8d8), getProperty<sal_Int32>(xCell, "BackColor"));
 }
 
+DECLARE_RTFEXPORT_TEST(testAbi10201, "abi10201.rtf")
+{
+    // crashtest
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index fd1eca3..d60d5c8 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -3021,9 +3021,12 @@ void RtfAttributeOutput::FormatBox( const SvxBoxItem& rBox )
             // We in fact need RGB to BGR, but the transformation is symmetric.
             m_aFlyProperties.push_back(std::make_pair<OString, OString>("lineColor", OString::number(msfilter::util::BGRToRGB(rColor.GetColor()))));
 
-            double const fConverted(editeng::ConvertBorderWidthToWord(pTop->GetBorderLineStyle(), pTop->GetWidth()));
-            sal_Int32 nWidth = sal_Int32(fConverted * 635); // Twips -> EMUs
-            m_aFlyProperties.push_back(std::make_pair<OString, OString>("lineWidth", OString::number(nWidth)));
+            if (pTop->GetBorderLineStyle() != table::BorderLineStyle::NONE)
+            {
+                double const fConverted(editeng::ConvertBorderWidthToWord(pTop->GetBorderLineStyle(), pTop->GetWidth()));
+                sal_Int32 nWidth = sal_Int32(fConverted * 635); // Twips -> EMUs
+                m_aFlyProperties.push_back(std::make_pair<OString, OString>("lineWidth", OString::number(nWidth)));
+            }
         }
 
         return;


More information about the Libreoffice-commits mailing list