summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core')
-rw-r--r--[-rwxr-xr-x]sw/source/core/doc/doc.cxx12
-rw-r--r--sw/source/core/draw/dcontact.cxx33
-rw-r--r--sw/source/core/frmedt/feshview.cxx12
-rw-r--r--sw/source/core/layout/fly.cxx27
4 files changed, 76 insertions, 8 deletions
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 5ca8cb83d234..2df835f06c12 100755..100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1714,16 +1714,22 @@ sal_uInt16 SwDoc::GetPageCount() const
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();
}
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 2e19d482fc70..766c3ca86377 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1396,6 +1396,37 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
DisconnectFromLayout( false );
break;
}
+ 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 :
@@ -1403,8 +1434,6 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
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
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 17e4b1ed4873..f334ddcaee2f 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -599,7 +599,7 @@ bool SwFEShell::IsSelContainsControl() const
// 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;
}
@@ -994,8 +994,14 @@ void SwFEShell::ChangeOpaque( SdrLayerID nLayerId )
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 );
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index cd590d73ddcc..d69df532682f 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -51,6 +51,9 @@
#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#
@@ -2250,6 +2253,30 @@ void SwFrm::AppendDrawObj( SwAnchoredObject& _rNewObj )
_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();