Commits

Anonymous committed 570fcb3 Merge

CWS-TOOLING: integrate CWS sw33bf09

Comments (0)

Files changed (6)

sw/source/core/doc/doc.cxx

 const Size SwDoc::GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const
 {
     Size aSize;
-    if( GetRootFrm() && nPageNum )
+    if ( GetRootFrm() && nPageNum )
     {
         const SwPageFrm* pPage = static_cast<const SwPageFrm*>
                                  (GetRootFrm()->Lower());
 
-        while( --nPageNum && pPage->GetNext() )
+        while ( --nPageNum && pPage->GetNext() )
+        {        
             pPage = static_cast<const SwPageFrm*>( pPage->GetNext() );
+        }
 
-        if( !bSkipEmptyPages && pPage->IsEmptyPage() && pPage->GetNext() )
+        // switch to next page for an empty page, if empty pages are not skipped
+        // in order to get a sensible page size for an empty page - e.g. for printing.
+        if ( !bSkipEmptyPages && pPage->IsEmptyPage() && pPage->GetNext() )
+        {        
             pPage = static_cast<const SwPageFrm*>( pPage->GetNext() );
+        }
 
         aSize = pPage->Frm().SSize();
     }

sw/source/core/draw/dcontact.cxx

                 DisconnectFromLayout( false );
 				break;
 			}
-		case SDRUSERCALL_MOVEONLY:
+        case SDRUSERCALL_CHILD_INSERTED :
+        case SDRUSERCALL_CHILD_REMOVED :
+        {
+            // --> AW, OD 2010-09-13 #i113730#
+            // force layer of controls for group objects containing control objects
+            if(dynamic_cast< SdrObjGroup* >(maAnchoredDrawObj.DrawObj()))
+            {
+                if(::CheckControlLayer(maAnchoredDrawObj.DrawObj()))
+                {
+                    const IDocumentDrawModelAccess* pIDDMA = static_cast<SwFrmFmt*>(pRegisteredIn)->getIDocumentDrawModelAccess();
+                    const SdrLayerID aCurrentLayer(maAnchoredDrawObj.DrawObj()->GetLayer());
+                    const SdrLayerID aControlLayerID(pIDDMA->GetControlsId());
+                    const SdrLayerID aInvisibleControlLayerID(pIDDMA->GetInvisibleControlsId());
+
+                    if(aCurrentLayer != aControlLayerID && aCurrentLayer != aInvisibleControlLayerID)
+                    {
+                        if ( aCurrentLayer == pIDDMA->GetInvisibleHellId() ||
+                             aCurrentLayer == pIDDMA->GetInvisibleHeavenId() )
+                        {
+                            maAnchoredDrawObj.DrawObj()->SetLayer(aInvisibleControlLayerID);
+                        }
+                        else
+                        {        
+                            maAnchoredDrawObj.DrawObj()->SetLayer(aControlLayerID);
+                        }
+                    }
+                }
+            }
+            // fallthrough intended here
+            // <--
+        }
+        case SDRUSERCALL_MOVEONLY:
 		case SDRUSERCALL_RESIZE:
 		case SDRUSERCALL_CHILD_MOVEONLY :
 		case SDRUSERCALL_CHILD_RESIZE :
 		case SDRUSERCALL_CHILD_CHGATTR :
 		case SDRUSERCALL_CHILD_DELETE :
 		case SDRUSERCALL_CHILD_COPY :
-		case SDRUSERCALL_CHILD_INSERTED :
-		case SDRUSERCALL_CHILD_REMOVED :
         {
             // --> OD 2004-08-04 #i31698# - improvement:
             // get instance <SwAnchoredDrawObject> only once

sw/source/core/frmedt/feshview.cxx

         // if we have one marked object, get the SdrObject and check
         // whether it contains a control
         const SdrObject* pSdrObject = pMarkList->GetMark( 0 )->GetMarkedSdrObj();
-        bRet = CheckControlLayer( pSdrObject );
+        bRet = ::CheckControlLayer( pSdrObject );
     }
     return bRet;
 }
             SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
             // OD 21.08.2003 #i18447# - no change of layer for controls
             // or group objects containing controls.
-            const bool bControlObj = ::CheckControlLayer( pObj );
-            //if ( pObj->GetLayer() != nLayerId && pObj->GetLayer() != nControls )
+            // --> OD 2010-09-14 #i113730#
+            // consider that a member of a drawing group has been selected.
+            const SwContact* pContact = ::GetUserCall( pObj );
+            ASSERT( pContact && pContact->GetMaster(), "<SwFEShell::ChangeOpaque(..)> - missing contact or missing master object at contact!" );
+            const bool bControlObj = ( pContact && pContact->GetMaster() )
+                                     ? ::CheckControlLayer( pContact->GetMaster() )
+                                     : ::CheckControlLayer( pObj );
+            // <--
             if ( !bControlObj && pObj->GetLayer() != nLayerId )
 			{
 				pObj->SetLayer( nLayerId );

sw/source/core/layout/fly.cxx

 #include <layhelp.hxx>
 #include <ndtxt.hxx>
 
+// --> OD 2010-09-14 #i113730#
+#include <svx/svdogrp.hxx>
+// <--
 // OD 16.04.2003 #i13147# - for <SwFlyFrm::GetContour(..)>
 #include <ndgrf.hxx>
 // OD 29.10.2003 #113049#
         _rNewObj.ChgAnchorFrm( this );
     }
 
+    // --> OD 2010-09-14 #i113730#
+    // Assure the control objects and group objects containing controls are on the control layer
+    if ( ::CheckControlLayer( _rNewObj.DrawObj() ) )
+    {
+        const IDocumentDrawModelAccess* pIDDMA = GetUpper()->GetFmt()->getIDocumentDrawModelAccess();
+        const SdrLayerID aCurrentLayer(_rNewObj.DrawObj()->GetLayer());
+        const SdrLayerID aControlLayerID(pIDDMA->GetControlsId());
+        const SdrLayerID aInvisibleControlLayerID(pIDDMA->GetInvisibleControlsId());
+
+        if(aCurrentLayer != aControlLayerID && aCurrentLayer != aInvisibleControlLayerID)
+        {
+            if ( aCurrentLayer == pIDDMA->GetInvisibleHellId() ||
+                 aCurrentLayer == pIDDMA->GetInvisibleHeavenId() )
+            {
+                _rNewObj.DrawObj()->SetLayer(aInvisibleControlLayerID);
+            }
+            else
+            {        
+                _rNewObj.DrawObj()->SetLayer(aControlLayerID);
+            }
+        }
+    }
+    // <--
+
     // no direct positioning needed, but invalidate the drawing object position
     _rNewObj.InvalidateObjPos();
 

sw/source/filter/xml/xmlexpit.cxx

 
             if( MID_PAGEDESC_PAGENUMOFFSET==nMemberId )
             {
-
-                rUnitConverter.convertNumber(
-                    aOut, (sal_Int32)pPageDesc->GetNumOffset() );
+                sal_Int32 const number(pPageDesc->GetNumOffset());
+                if (0 >= number)
+                {
+                    aOut.append(GetXMLToken(XML_AUTO));
+                }
+                else // #i114163# positiveInteger only!
+                {
+                    rUnitConverter.convertNumber(aOut, number);
+                }
                 bOk = sal_True;
             }
         }

sw/source/ui/uno/unotxdoc.cxx

     uno::Sequence< beans::PropertyValue > aRenderer;
     if (m_pRenderData)
     {
-        const USHORT nPage = nRenderer + 1;
+        // --> TL, OD 2010-09-07 #i114210#
+        // determine the correct page number from the renderer index
+        const USHORT nPage = m_pRenderData->GetPagesToPrint()[ nRenderer ];
+        // <--
         
         // get paper tray to use ... 
         sal_Int32 nPrinterPaperTray = -1;