[Libreoffice-commits] .: Branch 'libreoffice-3-4' - 2 commits - sw/inc sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Fri May 13 07:51:52 PDT 2011


 sw/inc/fesh.hxx                     |    3 ++-
 sw/source/core/layout/frmtool.cxx   |    8 +++++++-
 sw/source/filter/ww8/docxexport.cxx |    2 +-
 sw/source/filter/ww8/wrtw8nds.cxx   |   10 +++++-----
 sw/source/filter/ww8/wrtww8.cxx     |   30 +++++++++++++++++++++++++-----
 sw/source/filter/ww8/wrtww8.hxx     |    5 +++--
 sw/source/filter/ww8/wrtww8gr.cxx   |    2 +-
 sw/source/filter/ww8/ww8atr.cxx     |    2 +-
 sw/source/ui/inc/wrtsh.hxx          |    3 ++-
 sw/source/ui/wrtsh/wrtsh1.cxx       |   14 ++++++++------
 10 files changed, 55 insertions(+), 24 deletions(-)

New commits:
commit a6f2e395963747729c0104e17afecf32d7e119c5
Author: Henning Brinkmann <hbrinkm at openoffice.org>
Date:   Fri May 13 16:47:44 2011 +0200

    sw34bf06: #i104384#: problem exporting section breaks in tables
    
    Replace MSWordExportBase::bInTable by MSWordExportBase::IsInTable()
    
    Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>

diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 074a128..33312da 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -378,7 +378,7 @@ void DocxExport::OutputEndNode( const SwEndNode& rEndNode )
         if ( rNd.IsEndNode() && rNd.StartOfSectionNode()->IsSectionNode() )
             return;
 
-        if ( !rNd.IsSectionNode() && !bIsInTable ) // No sections in table
+        if ( !rNd.IsSectionNode() && IsInTable() ) // No sections in table
         {
             const SwSectionFmt* pParentFmt = rSect.GetFmt()->GetParent();
             if( !pParentFmt )
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index fff7c63..7808f89 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1748,7 +1748,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
 
     AttrOutput().StartParagraph( pTextNodeInfo );
 
-    bool bFlyInTable = mpParentFrame && bIsInTable;
+    bool bFlyInTable = mpParentFrame && IsInTable();
 
     if ( !bFlyInTable )
         nStyleBeforeFly = GetId( lcl_getFormatCollection( *this, &rNode ) );
@@ -2021,7 +2021,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
 
     AttrOutput().ParagraphStyle( nStyle );
 
-    if ( mpParentFrame && !bIsInTable )    // Fly-Attrs
+    if ( mpParentFrame && IsInTable() )    // Fly-Attrs
         OutputFormat( mpParentFrame->GetFrmFmt(), false, false, true );
 
     if ( pTextNodeInfo.get() != NULL )
@@ -2419,7 +2419,7 @@ void MSWordExportBase::OutputSectionNode( const SwSectionNode& rSectionNode )
 
     SwNodeIndex aIdx( rSectionNode, 1 );
     const SwNode& rNd = aIdx.GetNode();
-    if ( !rNd.IsSectionNode() && !bIsInTable ) //No sections in table
+    if ( !rNd.IsSectionNode() && !IsInTable() ) //No sections in table
     {
         // Bug 74245 - if the first Node inside the section has an own
         //              PageDesc or PageBreak attribut, then dont write
@@ -2569,7 +2569,7 @@ void WW8AttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFmt, const Point
         if( nStt >= nEnd )      // kein Bereich, also kein gueltiger Node
             return;
 
-        if ( !m_rWW8Export.bIsInTable && rFmt.IsInline() )
+        if ( !m_rWW8Export.IsInTable() && rFmt.IsInline() )
         {
             //Test to see if this textbox contains only a single graphic/ole
             SwTxtNode* pParTxtNode = rAnch.GetCntntAnchor()->nNode.GetNode().GetTxtNode();
@@ -2597,7 +2597,7 @@ void WW8AttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFmt, const Point
 
             m_rWW8Export.mpParentFrame = &rFmt;
             if (
-                 m_rWW8Export.bIsInTable &&
+                m_rWW8Export.IsInTable() &&
                  (FLY_AT_PAGE != rAnch.GetAnchorId()) &&
                  !m_rWW8Export.pDoc->GetNodes()[ nStt ]->IsNoTxtNode()
                )
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 6d8fe00..6cd10cb 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1776,7 +1776,6 @@ void MSWordExportBase::SaveData( sal_uLong nStt, sal_uLong nEnd )
     aData.eOldAnchorType = eNewAnchorType;
 
     aData.bOldOutTable = bOutTable;
-    aData.bOldIsInTable = bIsInTable;
     aData.bOldFlyFrmAttrs = bOutFlyFrmAttrs;
     aData.bOldStartTOX = bStartTOX;
     aData.bOldInWriteTOX = bInWriteTOX;
@@ -1811,7 +1810,6 @@ void MSWordExportBase::RestoreData()
     pOrigPam = rData.pOldEnd;
 
     bOutTable = rData.bOldOutTable;
-    bIsInTable = rData.bOldIsInTable;
     bOutFlyFrmAttrs = rData.bOldFlyFrmAttrs;
     bStartTOX = rData.bOldStartTOX;
     bInWriteTOX = rData.bOldInWriteTOX;
@@ -2432,7 +2430,7 @@ void WW8Export::SectionBreaksAndFrames( const SwTxtNode& rNode )
     OutputSectionBreaks( rNode.GetpSwAttrSet(), rNode );
 
     // all textframes anchored as character for the winword 7- format
-    if ( !bWrtWW8 && !bIsInTable )
+    if ( !bWrtWW8 && !IsInTable() )
         OutWW6FlyFrmsInCntnt( rNode );
 }
 
@@ -2488,7 +2486,7 @@ void MSWordExportBase::WriteText()
                 ;
             else if ( aIdx.GetNode().IsSectionNode() )
                 ;
-            else if ( !bIsInTable ) //No sections in table
+            else if ( !IsInTable() ) //No sections in table
             {
                 ReplaceCr( (char)0xc ); // Indikator fuer Page/Section-Break
 
@@ -2567,6 +2565,28 @@ void WW8Export::WriteMainText()
 #endif
 }
 
+bool MSWordExportBase::IsInTable() const
+{
+    bool bResult = false;
+
+    if (pCurPam != NULL)
+    {
+        SwNode * pNode = pCurPam->GetNode();
+
+        if (pNode != NULL && mpTableInfo.get() != NULL)
+        {
+            ww8::WW8TableNodeInfo::Pointer_t pTableNodeInfo = mpTableInfo->getTableNodeInfo(pNode);
+
+            if (pTableNodeInfo.get() != NULL && pTableNodeInfo->getDepth() > 0)
+            {
+                bResult = true;
+            }
+        }
+    }
+
+    return bResult;
+}
+
 typedef ww8::WW8Sttb< ww8::WW8Struct >  WW8SttbAssoc;
 
 void WW8Export::WriteFkpPlcUsw()
@@ -2873,7 +2893,7 @@ void MSWordExportBase::ExportDocument( bool bWriteAll )
 
     bStyDef = bBreakBefore = bOutKF =
         bOutFlyFrmAttrs = bOutPageDescs = bOutTable = bOutFirstPage =
-        bIsInTable = bOutGrf = bInWriteEscher = bStartTOX =
+        bOutGrf = bInWriteEscher = bStartTOX =
         bInWriteTOX = false;
 
     bFtnAtTxtEnd = bEndAtTxtEnd = true;
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index a6e8ae6..417d0e0 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -539,8 +539,6 @@ public:
     sal_uInt8 bOutFirstPage : 1;     // write Attrset of FirstPageDesc
     sal_uInt8 bOutTable : 1;         // Tabelle wird ausgegeben
                                 //    ( wird zB bei Flys in Tabelle zurueckgesetzt )
-    sal_uInt8 bIsInTable : 1;        // wird sind innerhalb der Ausgabe einer Tabelle
-                                //    ( wird erst nach der Tabelle zurueckgesetzt )
     sal_uInt8 bOutGrf : 1;           // Grafik wird ausgegeben
     sal_uInt8 bInWriteEscher : 1;    // in write textboxes
     sal_uInt8 bStartTOX : 1;         // true: a TOX is startet
@@ -572,6 +570,9 @@ public:
     /// Iterate through the nodes and call the appropriate OutputNode() on them.
     void WriteText();
 
+    /// Return whether cuurently exported node is in table.
+    bool IsInTable() const;
+
     /// Set the pCurPam appropriately and call WriteText().
     ///
     /// Used to export paragraphs in footnotes/endnotes/etc.
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index 3f07ea8..9da0acc 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -497,7 +497,7 @@ void WW8Export::OutGrf(const sw::Frame &rFrame)
     // Otherwise, an additional paragraph is exported for a graphic, which is
     // forced to be treated as inline, because it's anchored inside another frame.
     if ( !rFrame.IsInline() &&
-         ( ((eAn == FLY_AT_PARA) && ( bWrtWW8 || !bIsInTable )) ||
+         ( ((eAn == FLY_AT_PARA) && ( bWrtWW8 || !IsInTable() )) ||
            (eAn == FLY_AT_PAGE)) )
     // <--
     {
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 9448cca..901d8fb 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1472,7 +1472,7 @@ void WW8AttributeOutput::CharRotate( const SvxCharRotateItem& rRotate )
     if ( !rRotate.GetValue() )
         return;
 
-    if ( m_rWW8Export.bWrtWW8 && !m_rWW8Export.bIsInTable )
+    if ( m_rWW8Export.bWrtWW8 && !m_rWW8Export.IsInTable() )
     {
         // #i36867 In word the text in a table is rotated via the TC or NS_sprm::LN_TTextFlow
         // This means you can only rotate all or none of the text adding NS_sprm::LN_CEastAsianLayout
commit 47f7b6d36ea6059d2cc770f7e752cade18bce345
Author: Oliver-Rainer Wittmann <od at openoffice.org>
Date:   Fri May 13 16:33:26 2011 +0200

    sw34bf06: #i117189# - refine condition for non-resizable objects
    
    Refine condition for non-resizable objects to apply its size back
    via new parameter <bNoTxtFrmPrtAreaChanged>. Otherwise non-resizable
    objects are always reloaded.
    
    Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>

diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 5cf3e9b..7cd094f 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -410,7 +410,8 @@ public:
     // Else the size is provided via GetCurFlyRect().
     virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
                                   const SwRect *pFlyPrtRect = 0,
-                                  const SwRect *pFlyFrmRect = 0 ) = 0;
+                                  const SwRect *pFlyFrmRect = 0,
+                                  const bool bNoTxtFrmPrtAreaChanged = false ) = 0;
 
     // Connect objects with ActivateWhenVisible at Paint.
     // Called by notxtfrm::Paint, implemented in wrtsh.
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 2bbdde1..8a9e401 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -889,6 +889,10 @@ SwCntntNotify::~SwCntntNotify()
                  (pNd->GetOLEObj().IsOleRef() ||
                   pNd->IsOLESizeInvalid()) )
             {
+                const bool bNoTxtFrmPrtAreaChanged =
+                        ( aPrt.SSize().Width() != 0 &&
+                          aPrt.SSize().Height() != 0 ) &&
+                        aPrt.SSize() != pCnt->Prt().SSize();
                 OSL_ENSURE( pCnt->IsInFly(), "OLE not in FlyFrm" );
                 SwFlyFrm *pFly = pCnt->FindFlyFrm();
                 svt::EmbeddedObjectRef& xObj = pNd->GetOLEObj().GetObject();
@@ -915,7 +919,9 @@ SwCntntNotify::~SwCntntNotify()
                         // uiview/view.cxx.
                         if ( !pNd->IsOLESizeInvalid() &&
                              !pSh->GetDoc()->IsUpdateExpFld() )
-                            pFESh->CalcAndSetScale( xObj, &pFly->Prt(), &pFly->Frm());
+                            pFESh->CalcAndSetScale( xObj,
+                                                    &pFly->Prt(), &pFly->Frm(),
+                                                    bNoTxtFrmPrtAreaChanged );
                     }
                     pTmp = (ViewShell*)pTmp->GetNext();
                 } while ( pTmp != pSh );
diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx
index 20a06fc..8b1cdf5 100644
--- a/sw/source/ui/inc/wrtsh.hxx
+++ b/sw/source/ui/inc/wrtsh.hxx
@@ -347,7 +347,8 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
     virtual void MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset );
     virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
                                   const SwRect *pFlyPrtRect = 0,
-                                  const SwRect *pFlyFrmRect = 0 );
+                                  const SwRect *pFlyFrmRect = 0,
+                                  const bool bNoTxtFrmPrtAreaChanged = false );
     virtual void ConnectObj( svt::EmbeddedObjectRef&  xIPObj, const SwRect &rPrt,
                              const SwRect &rFrm );
 
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index 50d1e42..69c2407 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -664,8 +664,9 @@ void SwWrtShell::MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point&
 
 
 void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
-                             const SwRect *pFlyPrtRect,
-                             const SwRect *pFlyFrmRect )
+                                  const SwRect *pFlyPrtRect,
+                                  const SwRect *pFlyFrmRect,
+                                  const bool bNoTxtFrmPrtAreaChanged )
 {
     //Einstellen der Skalierung am Client. Diese ergibt sich aus der Differenz
     //zwischen der VisArea des Objektes und der ObjArea.
@@ -747,12 +748,13 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
     SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
     if ( !pCli )
     {
-        if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc) || bLinkingChart
+        if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc) 
+             || bLinkingChart
             // TODO/LATER: ResizeOnPrinterChange
              //|| SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & xObj->GetMiscStatus()
-             || nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE // non-resizable objects need to be
-                                                            // set the size back by this method
-             )
+             // --> OD #i117189# - refine condition for non-resizable objects                
+             // non-resizable objects need to be set the size back by this method
+             || ( bNoTxtFrmPrtAreaChanged && nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
         {
             pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
         }


More information about the Libreoffice-commits mailing list