Commits

Anonymous committed cba4eb3 Merge

merged DEV300_m0

Comments (0)

Files changed (10)

 	//besorgt.
     virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
 								  const SwRect *pFlyPrtRect = 0,
-								  const SwRect *pFlyFrmRect = 0 ) = 0;
+                                  const SwRect *pFlyFrmRect = 0,
+                                  const bool bNoTxtFrmPrtAreaChanged = false ) = 0;
 
 	//Objekte mit ActivateWhenVisible werden beim Paint Connected.
 	//gerufen von notxtfrm::Paint, impl in wrtsh

sw/source/core/layout/frmtool.cxx

 				 (pNd->GetOLEObj().IsOleRef() ||
 				  pNd->IsOLESizeInvalid()) )
 			{
+                // --> OD #i117189#
+                const bool bNoTxtFrmPrtAreaChanged = 
+                        ( aPrt.SSize().Width() != 0 && 
+                          aPrt.SSize().Height() != 0 ) &&
+                        aPrt.SSize() != pCnt->Prt().SSize();
+                // <--
 				ASSERT( pCnt->IsInFly(), "OLE not in FlyFrm" );
 				SwFlyFrm *pFly = pCnt->FindFlyFrm();
                 svt::EmbeddedObjectRef& xObj = pNd->GetOLEObj().GetObject();
                         // 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 );

sw/source/filter/ww8/wrtw8nds.cxx

 
     AttrOutput().StartParagraph( pTextNodeInfo );
 
-    bool bFlyInTable = mpParentFrame && bIsInTable;
+    bool bFlyInTable = mpParentFrame && IsInTable();
 
     if ( !bFlyInTable )
         nStyleBeforeFly = GetId( lcl_getFormatCollection( *this, &rNode ) );
     
     AttrOutput().ParagraphStyle( nStyle );
 
-    if ( mpParentFrame && !bIsInTable )    // Fly-Attrs
+    if ( mpParentFrame && IsInTable() )    // Fly-Attrs
         OutputFormat( mpParentFrame->GetFrmFmt(), false, false, true );
 
     if ( pTextNodeInfo.get() != NULL )
 
     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
         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();
 
             m_rWW8Export.mpParentFrame = &rFmt;
             if (
-                 m_rWW8Export.bIsInTable &&
+                m_rWW8Export.IsInTable() &&
                  (FLY_AT_PAGE != rAnch.GetAnchorId()) &&
                  !m_rWW8Export.pDoc->GetNodes()[ nStt ]->IsNoTxtNode()
                )

sw/source/filter/ww8/wrtw8sty.cxx

     {
         if ( m_rWW8Export.bWrtWW8 )
         {
-            static sal_uInt8 __READONLY_DATA aDefCharSty[] = {
-                0x42, 0x00,
-                0x41, 0x40, 0xF2, 0xFF, 0xA1, 0x00, 0x42, 0x00,
-                0x00, 0x00, 0x19, 0x00, 0x41, 0x00, 0x62, 0x00,
-                0x73, 0x00, 0x61, 0x00, 0x74, 0x00, 0x7A, 0x00,
-                0x2D, 0x00, 0x53, 0x00, 0x74, 0x00, 0x61, 0x00,
-                0x6E, 0x00, 0x64, 0x00, 0x61, 0x00, 0x72, 0x00,
-                0x64, 0x00, 0x73, 0x00, 0x63, 0x00, 0x68, 0x00,
-                0x72, 0x00, 0x69, 0x00, 0x66, 0x00, 0x74, 0x00,
-                0x61, 0x00, 0x72, 0x00, 0x74, 0x00, 0x00, 0x00,
-                0x00, 0x00 };
-            m_rWW8Export.pTableStrm->Write( &aDefCharSty, sizeof( aDefCharSty ) );
+            sal_uInt16 n = 0;
+            m_rWW8Export.pTableStrm->Write( &n , 2 );   // empty Style
         }
         else
         {
     else
     {
         sal_uInt16 n = 0;
-        m_rWW8Export.pTableStrm->Write( &n , 2 );   // leerer Style
+        m_rWW8Export.pTableStrm->Write( &n , 2 );   // empty Style
     }
 }
 

sw/source/filter/ww8/wrtww8.cxx

     aData.eOldAnchorType = eNewAnchorType;
 
     aData.bOldOutTable = bOutTable;
-    aData.bOldIsInTable = bIsInTable;
     aData.bOldFlyFrmAttrs = bOutFlyFrmAttrs;
     aData.bOldStartTOX = bStartTOX;
     aData.bOldInWriteTOX = bInWriteTOX;
     pOrigPam = rData.pOldEnd;
 
     bOutTable = rData.bOldOutTable;
-    bIsInTable = rData.bOldIsInTable;
     bOutFlyFrmAttrs = rData.bOldFlyFrmAttrs;
     bStartTOX = rData.bOldStartTOX;
     bInWriteTOX = rData.bOldInWriteTOX;
     OutputSectionBreaks( rNode.GetpSwAttrSet(), rNode );
 
     // all textframes anchored as character for the winword 7- format
-    if ( !bWrtWW8 && !bIsInTable )
+    if ( !bWrtWW8 && !IsInTable() )
         OutWW6FlyFrmsInCntnt( rNode );
 }
 
                 ;
             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
 
 #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()
 
     bStyDef = bBreakBefore = bOutKF =
         bOutFlyFrmAttrs = bOutPageDescs = bOutTable = bOutFirstPage =
-        bIsInTable = bOutGrf = bInWriteEscher = bStartTOX =
+        bOutGrf = bInWriteEscher = bStartTOX =
         bInWriteTOX = false;
 
     bFtnAtTxtEnd = bEndAtTxtEnd = true;

sw/source/filter/ww8/wrtww8.hxx

     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
     /// 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.

sw/source/filter/ww8/wrtww8gr.cxx

     // 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)) )
     // <--
     {

sw/source/filter/ww8/ww8atr.cxx

     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

sw/source/ui/inc/wrtsh.hxx

 	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 );
 

sw/source/ui/wrtsh/wrtsh1.cxx

 
 
 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.
     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 );
         }