[Libreoffice-commits] .: sw/source

Miklos Vajna vmiklos at kemper.freedesktop.org
Wed Jan 12 17:14:41 PST 2011


 sw/source/filter/ww8/rtfattributeoutput.cxx |   12 ++++++++----
 sw/source/filter/ww8/rtfattributeoutput.hxx |    2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit c27e4668b18248322be699fc9fc6bf01e4d6a7ea
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Thu Jan 13 02:04:21 2011 +0100

    RTF: fix height of wrapped pictures on export (partial fix for fdo#32613)

diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 8ea30b8..82b0eab 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -1524,7 +1524,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi
             }
 
             if ( pGrfNode )
-                FlyFrameGraphic( dynamic_cast<const SwFlyFrmFmt*>( &rFrame.GetFrmFmt() ), *pGrfNode, rFrame.GetLayoutSize() );
+                FlyFrameGraphic( dynamic_cast<const SwFlyFrmFmt*>( &rFrame.GetFrmFmt() ), *pGrfNode);
             break;
         case sw::Frame::eDrawing:
             {
@@ -3359,7 +3359,7 @@ void RtfAttributeOutput::FlyFrameOLE( const SwFlyFrmFmt* pFlyFrmFmt, SwOLENode&
     m_aRunText.append("}}}}");
 }
 
-void RtfAttributeOutput::FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const SwGrfNode& rGrfNode, const Size& rSize )
+void RtfAttributeOutput::FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const SwGrfNode& rGrfNode)
 {
     OSL_TRACE("%s", OSL_THIS_FUNC);
 
@@ -3418,8 +3418,12 @@ void RtfAttributeOutput::FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const S
     //Get original size in twips
     Size aSize(sw::util::GetSwappedInSize(rGrfNode));
     Size aRendered(aSize);
-    aRendered.Width() = rSize.Width();
-    aRendered.Height() = rSize.Height();
+    if (pFlyFrmFmt)
+    {
+        const SwFmtFrmSize& rS = pFlyFrmFmt->GetFrmSize();
+        aRendered.Width() = rS.GetWidth();
+        aRendered.Height() = rS.GetHeight();
+    }
 
     /*
        If the graphic is not of type WMF then we will have to store two
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx
index 9b3923d..17de606 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.hxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -432,7 +432,7 @@ protected:
 private:
 
     /// Output graphic fly frames.
-    void FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const SwGrfNode& rGrfNode, const Size& rSize );
+    void FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const SwGrfNode& rGrfNode );
     void FlyFrameOLE( const SwFlyFrmFmt* pFlyFrmFmt, SwOLENode& rOLENode, const Size& rSize );
     void FlyFrameOLEData( SwOLENode& rOLENode );
 


More information about the Libreoffice-commits mailing list