Kaydet (Commit) 5cb604d7 authored tarafından Rüdiger Timm's avatar Rüdiger Timm

INTEGRATION: CWS swqbf89 (1.38.50); FILE MERGED

2006/11/07 09:39:50 od 1.38.50.1: #130889# method <SwDoc::UnGroupSelection(..)>
	 - change sub action order in order to avoid wrong behaviour
	   in Drawing layer with drawing objects in repeated areas (e.g.
	   page header, page footer, repeated table rows). This change
	   causes also adjustments for the undo actions.
üst 12be8592
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: docdraw.cxx,v $ * $RCSfile: docdraw.cxx,v $
* *
* $Revision: 1.39 $ * $Revision: 1.40 $
* *
* last change: $Author: ihi $ $Date: 2006-11-14 15:08:09 $ * last change: $Author: rt $ $Date: 2006-12-01 14:23:59 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -175,7 +175,9 @@ ...@@ -175,7 +175,9 @@
#include <svx/svditer.hxx> #include <svx/svditer.hxx>
#endif #endif
// <-- // <--
// --> OD 2006-11-01 #130889#
#include <vector>
// <--
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::linguistic2; using namespace ::com::sun::star::linguistic2;
...@@ -420,7 +422,7 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView ) ...@@ -420,7 +422,7 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
void SwDoc::UnGroupSelection( SdrView& rDrawView ) void SwDoc::UnGroupSelection( SdrView& rDrawView )
{ {
int bUndo = DoesUndo(); const int bUndo = DoesUndo();
if( bUndo ) if( bUndo )
ClearRedo(); ClearRedo();
...@@ -429,14 +431,21 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView ) ...@@ -429,14 +431,21 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
SwDrawView::ReplaceMarkedDrawVirtObjs( rDrawView ); SwDrawView::ReplaceMarkedDrawVirtObjs( rDrawView );
const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList(); const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList();
if( rMrkList.GetMarkCount() ) // --> OD 2006-11-01 #130889#
std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > >* pFmtsAndObjs( 0L );
const sal_uInt32 nMarkCount( rMrkList.GetMarkCount() );
// <--
if ( nMarkCount )
{ {
// --> OD 2006-11-01 #130889#
pFmtsAndObjs = new std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > >[nMarkCount];
// <--
SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj(); SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
if( !pObj->GetUpGroup() ) if( !pObj->GetUpGroup() )
{ {
String sDrwFmtNm( String::CreateFromAscii( String sDrwFmtNm( String::CreateFromAscii(
RTL_CONSTASCII_STRINGPARAM("DrawObject" ))); RTL_CONSTASCII_STRINGPARAM("DrawObject" )));
for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i ) for ( USHORT i = 0; i < nMarkCount; ++i )
{ {
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
if ( pObj->IsA( TYPE(SdrObjGroup) ) ) if ( pObj->IsA( TYPE(SdrObjGroup) ) )
...@@ -462,14 +471,20 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView ) ...@@ -462,14 +471,20 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
pFmt->SetPositionLayoutDir( pFmt->SetPositionLayoutDir(
com::sun::star::text::PositionLayoutDir::PositionInLayoutDirOfAnchor ); com::sun::star::text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
// <-- // <--
SwDrawContact* pContact = new SwDrawContact( pFmt, pSubObj ); // --> OD 2006-11-01 #130889#
// --> OD 2004-11-22 #i35635# // creation of <SwDrawContact> instances for the group
pContact->MoveObjToVisibleLayer( pSubObj ); // members and its connection to the Writer layout is
// done after intrinsic ungrouping.
// SwDrawContact* pContact = new SwDrawContact( pFmt, pSubObj );
// // --> OD 2004-11-22 #i35635#
// pContact->MoveObjToVisibleLayer( pSubObj );
// // <--
// pContact->ConnectToLayout();
// // OD 2004-04-07 #i26791# - Adjust positioning and
// // alignment attributes.
// lcl_AdjustPositioningAttr( pFmt, *pSubObj );
pFmtsAndObjs[i].push_back( std::pair< SwDrawFrmFmt*, SdrObject* >( pFmt, pSubObj ) );
// <-- // <--
pContact->ConnectToLayout();
// OD 2004-04-07 #i26791# - Adjust positioning and
// alignment attributes.
lcl_AdjustPositioningAttr( pFmt, *pSubObj );
if( bUndo ) if( bUndo )
pUndo->AddObj( i2, pFmt ); pUndo->AddObj( i2, pFmt );
...@@ -479,6 +494,37 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView ) ...@@ -479,6 +494,37 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
} }
} }
rDrawView.UnGroupMarked(); rDrawView.UnGroupMarked();
// --> OD 2006-11-01 #130889#
// creation of <SwDrawContact> instances for the former group members and
// its connection to the Writer layout.
for ( sal_uInt32 i = 0; i < nMarkCount; ++i )
{
SwUndoDrawUnGroupConnectToLayout* pUndo = 0;
if( bUndo )
{
pUndo = new SwUndoDrawUnGroupConnectToLayout();
AppendUndo( pUndo );
}
while ( pFmtsAndObjs[i].size() > 0 )
{
SwDrawFrmFmt* pFmt( pFmtsAndObjs[i].back().first );
SdrObject* pObj( pFmtsAndObjs[i].back().second );
pFmtsAndObjs[i].pop_back();
SwDrawContact* pContact = new SwDrawContact( pFmt, pObj );
pContact->MoveObjToVisibleLayer( pObj );
pContact->ConnectToLayout();
lcl_AdjustPositioningAttr( pFmt, *pObj );
if ( bUndo )
{
pUndo->AddFmtAndObj( pFmt, pObj );
}
}
}
delete [] pFmtsAndObjs;
// <--
} }
/************************************************************************* /*************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment