Kaydet (Commit) 8026d84b authored tarafından Luc Castermans's avatar Luc Castermans Kaydeden (comit) Stefan Knorr (astron)

translated german comments in order to help with bug bug fdo#36681

üst df8dfbd6
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
#include <ndtxt.hxx> #include <ndtxt.hxx>
#include <edimp.hxx> #include <edimp.hxx>
#include <swtable.hxx> #include <swtable.hxx>
#include <mvsave.hxx> // Strukturen zum Sichern beim Move/Delete #include <mvsave.hxx> // storage structures for Move/Delete
#include <ndgrf.hxx> #include <ndgrf.hxx>
#include <flyfrms.hxx> #include <flyfrms.hxx>
#include <flypos.hxx> #include <flypos.hxx>
...@@ -81,15 +81,15 @@ ...@@ -81,15 +81,15 @@
using ::rtl::OUString; using ::rtl::OUString;
using namespace ::com::sun::star; using namespace ::com::sun::star;
//Zum anmelden von Flys in Flys in ... // To register Flys in Flys in ...
//definiert in layout/frmtool.cxx // as defined in layout/frmtool.cxx
void RegistFlys( SwPageFrm*, const SwLayoutFrm* ); void RegistFlys( SwPageFrm*, const SwLayoutFrm* );
/*********************************************************************** /***********************************************************************
#* Class : SwDoc #* Class : SwDoc
#* Methode : UseSpzLayoutFmt #* Methode : UseSpzLayoutFmt
#* Beschreibung: Anhand des Request werden zu dem Format entsprechende #* Description : based on the request, changes to the specific layouts
#* Aenderungen an den Spezifischen Layouts vorgenommen. #* will be made, to fit to the format
#***********************************************************************/ #***********************************************************************/
sal_Bool lcl_SetNewFlyPos( const SwNode& rNode, SwFmtAnchor& rAnchor, sal_Bool lcl_SetNewFlyPos( const SwNode& rNode, SwFmtAnchor& rAnchor,
...@@ -123,16 +123,16 @@ sal_Bool lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm, ...@@ -123,16 +123,16 @@ sal_Bool lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm,
RndStdIds nNew = aNewAnch.GetAnchorId(); RndStdIds nNew = aNewAnch.GetAnchorId();
const SwFrm *pNewAnch; const SwFrm *pNewAnch;
//Neuen Anker ermitteln //determine new anchor
Point aTmpPnt( rPt ); Point aTmpPnt( rPt );
switch( nNew ) switch( nNew )
{ {
case FLY_AS_CHAR: // sollte der nicht auch mit hinein? case FLY_AS_CHAR: // also include this?
case FLY_AT_PARA: case FLY_AT_PARA:
case FLY_AT_CHAR: // LAYER_IMPL case FLY_AT_CHAR: // LAYER_IMPL
{ {
//Ausgehend von der linken oberen Ecke des Fly den // starting from the upper-left corner of the Fly,
//dichtesten CntntFrm suchen. // search nearest CntntFrm
const SwFrm* pFrm = rFrm.IsFlyFrm() ? ((SwFlyFrm&)rFrm).GetAnchorFrm() const SwFrm* pFrm = rFrm.IsFlyFrm() ? ((SwFlyFrm&)rFrm).GetAnchorFrm()
: &rFrm; : &rFrm;
pNewAnch = ::FindAnchor( pFrm, aTmpPnt ); pNewAnch = ::FindAnchor( pFrm, aTmpPnt );
...@@ -145,10 +145,10 @@ sal_Bool lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm, ...@@ -145,10 +145,10 @@ sal_Bool lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm,
SwPosition aPos( *((SwCntntFrm*)pNewAnch)->GetNode() ); SwPosition aPos( *((SwCntntFrm*)pNewAnch)->GetNode() );
if ((FLY_AT_CHAR == nNew) || (FLY_AS_CHAR == nNew)) if ((FLY_AT_CHAR == nNew) || (FLY_AS_CHAR == nNew))
{ {
// es muss ein TextNode gefunden werden, denn nur in diesen // textnode should be found, as only in those
// ist ein Inhaltsgebundene Frames zu verankern // a content bound frame can be anchored
SwCrsrMoveState aState( MV_SETONLYTEXT ); SwCrsrMoveState aState( MV_SETONLYTEXT );
aTmpPnt.X() -= 1; //nicht im Fly landen!! aTmpPnt.X() -= 1; // do not land in the fly!
if( !pNewAnch->GetCrsrOfst( &aPos, aTmpPnt, &aState ) ) if( !pNewAnch->GetCrsrOfst( &aPos, aTmpPnt, &aState ) )
{ {
SwCntntNode* pCNd = ((SwCntntFrm*)pNewAnch)->GetNode(); SwCntntNode* pCNd = ((SwCntntFrm*)pNewAnch)->GetNode();
...@@ -164,11 +164,11 @@ sal_Bool lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm, ...@@ -164,11 +164,11 @@ sal_Bool lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm,
case FLY_AT_FLY: // LAYER_IMPL case FLY_AT_FLY: // LAYER_IMPL
{ {
//Ausgehend von der linken oberen Ecke des Fly den // starting from the upper-left corner of the Fly
//dichtesten SwFlyFrm suchen. // search nearest SwFlyFrm
SwCrsrMoveState aState( MV_SETONLYTEXT ); SwCrsrMoveState aState( MV_SETONLYTEXT );
SwPosition aPos( rDoc.GetNodes() ); SwPosition aPos( rDoc.GetNodes() );
aTmpPnt.X() -= 1; //nicht im Fly landen!! aTmpPnt.X() -= 1; // do not land in the fly!
rDoc.GetCurrentLayout()->GetCrsrOfst( &aPos, aTmpPnt, &aState ); //swmod 071108//swmod 071225 rDoc.GetCurrentLayout()->GetCrsrOfst( &aPos, aTmpPnt, &aState ); //swmod 071108//swmod 071225
pNewAnch = ::FindAnchor( pNewAnch = ::FindAnchor(
aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( rFrm.getRootFrm(), 0, 0, sal_False ), aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( rFrm.getRootFrm(), 0, 0, sal_False ),
...@@ -219,7 +219,7 @@ sal_Bool lcl_ChkAndSetNewAnchor( const SwFlyFrm& rFly, SfxItemSet& rSet ) ...@@ -219,7 +219,7 @@ sal_Bool lcl_ChkAndSetNewAnchor( const SwFlyFrm& rFly, SfxItemSet& rSet )
OSL_ENSURE( !(nNew == FLY_AT_PAGE && OSL_ENSURE( !(nNew == FLY_AT_PAGE &&
(FLY_AT_PARA==nOld || FLY_AT_CHAR==nOld || FLY_AS_CHAR==nOld ) && (FLY_AT_PARA==nOld || FLY_AT_CHAR==nOld || FLY_AS_CHAR==nOld ) &&
pDoc->IsInHeaderFooter( rOldAnch.GetCntntAnchor()->nNode )), pDoc->IsInHeaderFooter( rOldAnch.GetCntntAnchor()->nNode )),
"Unerlaubter Ankerwechsel in Head/Foot." ); "forbidden anchor change in Head/Foot." );
#endif #endif
return ::lcl_FindAnchorPos( *pDoc, rFly.Frm().Pos(), rFly, rSet ); return ::lcl_FindAnchorPos( *pDoc, rFly.Frm().Pos(), rFly, rSet );
...@@ -229,24 +229,23 @@ void SwFEShell::SelectFlyFrm( SwFlyFrm& rFrm, sal_Bool bNew ) ...@@ -229,24 +229,23 @@ void SwFEShell::SelectFlyFrm( SwFlyFrm& rFrm, sal_Bool bNew )
{ {
SET_CURR_SHELL( this ); SET_CURR_SHELL( this );
// Wenn es ein neuer Rahmen ist, so soll er selektiert sein. // The frame is new, thus select it.
// !!Rahmen immer selektieren, wenn sie nicht selektiert sind. // !! Always select the frame, if it's not selected.
// - Es kann ein neuer 'alter' sein weil der Anker gewechselt wurde. // - it could be a new "old" one because the anchor was changed
// - 'alte' Rahmen sind vorher immer selektiert denn sonst wird nix // - "old" frames have had to be selected previously otherwise they could
// an ihnen veraendert. // not have been changed
// Der Rahmen darf nicht per Dokumentposition selektiert werden, weil er // The frames should not be selected by the document position, because
// auf jedenfall selektiert sein muss! // it should have been selected!
SwViewImp *pImpl = Imp(); SwViewImp *pImpl = Imp();
if( GetWin() && (bNew || !pImpl->GetDrawView()->AreObjectsMarked()) ) if( GetWin() && (bNew || !pImpl->GetDrawView()->AreObjectsMarked()) )
{ {
OSL_ENSURE( rFrm.IsFlyFrm(), "SelectFlyFrm will einen Fly" ); OSL_ENSURE( rFrm.IsFlyFrm(), "SelectFlyFrm will einen Fly" );
//Wenn der Fly bereits selektiert ist gibt es hier ja wohl nichts // nothing to be done if the Fly already was selected
//zu tun.
if ( FindFlyFrm() == &rFrm ) if ( FindFlyFrm() == &rFrm )
return; return;
//Damit der Anker ueberhaupt noch gepaintet wird. // assure the anchor is drawn
if( rFrm.IsFlyInCntFrm() && rFrm.GetAnchorFrm() ) if( rFrm.IsFlyInCntFrm() && rFrm.GetAnchorFrm() )
rFrm.GetAnchorFrm()->SetCompletePaint(); rFrm.GetAnchorFrm()->SetCompletePaint();
...@@ -265,7 +264,7 @@ void SwFEShell::SelectFlyFrm( SwFlyFrm& rFrm, sal_Bool bNew ) ...@@ -265,7 +264,7 @@ void SwFEShell::SelectFlyFrm( SwFlyFrm& rFrm, sal_Bool bNew )
|* |*
|* SwFEShell::FindFlyFrm() |* SwFEShell::FindFlyFrm()
|* |*
|* Beschreibung Liefert den Fly wenn einer Selektiert ist. |* Description returns a Fly if one is selected
|* |*
*************************************************************************/ *************************************************************************/
...@@ -273,7 +272,7 @@ SwFlyFrm *SwFEShell::FindFlyFrm() const ...@@ -273,7 +272,7 @@ SwFlyFrm *SwFEShell::FindFlyFrm() const
{ {
if ( Imp()->HasDrawView() ) if ( Imp()->HasDrawView() )
{ {
// Ein Fly ist genau dann erreichbar, wenn er selektiert ist. // A Fly is only accessible if it is selected
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
if( rMrkList.GetMarkCount() != 1 ) if( rMrkList.GetMarkCount() != 1 )
return 0; return 0;
...@@ -288,8 +287,8 @@ SwFlyFrm *SwFEShell::FindFlyFrm() const ...@@ -288,8 +287,8 @@ SwFlyFrm *SwFEShell::FindFlyFrm() const
|* |*
|* SwFEShell::IsFlyInFly() |* SwFEShell::IsFlyInFly()
|* |*
|* Beschreibung Liefert sal_True, wenn der aktuelle Fly an einem anderen |* Description Returns sal_True, if the current Fly could be anchored
|* verankert werden koennte (also innerhalb ist) |* to another one (so it is inside)
|* |*
*************************************************************************/ *************************************************************************/
...@@ -336,7 +335,7 @@ const SwFrmFmt* SwFEShell::IsFlyInFly() ...@@ -336,7 +335,7 @@ const SwFrmFmt* SwFEShell::IsFlyInFly()
SwNodeIndex aSwNodeIndex( GetDoc()->GetNodes() ); SwNodeIndex aSwNodeIndex( GetDoc()->GetNodes() );
SwPosition aPos( aSwNodeIndex ); SwPosition aPos( aSwNodeIndex );
Point aPoint( aTmpPos ); Point aPoint( aTmpPos );
aPoint.X() -= 1; //nicht im Fly landen!! aPoint.X() -= 1; //do not land in the fly!!
GetLayout()->GetCrsrOfst( &aPos, aPoint, &aState ); GetLayout()->GetCrsrOfst( &aPos, aPoint, &aState );
// determine text frame by left-top-corner of object // determine text frame by left-top-corner of object
pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aTmpPos, 0, sal_False ); pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aTmpPos, 0, sal_False );
...@@ -358,7 +357,7 @@ void SwFEShell::SetFlyPos( const Point& rAbsPos ) ...@@ -358,7 +357,7 @@ void SwFEShell::SetFlyPos( const Point& rAbsPos )
{ {
SET_CURR_SHELL( this ); SET_CURR_SHELL( this );
//Bezugspunkt in Dokumentkoordinaten bestimmen // Determine reference point in document coordinates
SwCntntFrm *pCntnt = GetCurrFrm( sal_False ); SwCntntFrm *pCntnt = GetCurrFrm( sal_False );
if( !pCntnt ) if( !pCntnt )
return; return;
...@@ -368,9 +367,8 @@ void SwFEShell::SetFlyPos( const Point& rAbsPos ) ...@@ -368,9 +367,8 @@ void SwFEShell::SetFlyPos( const Point& rAbsPos )
//SwSaveHdl aSaveX( Imp() ); //SwSaveHdl aSaveX( Imp() );
//Bei Absatzgebundenen Flys muss ausgehend von der absoluten // Set an anchor starting from the absolute position for paragraph bound Flys
//Position ein neuer Anker gesetzt werden. Anker und neue RelPos werden // Anchor and new RelPos will be calculated and set by the Fly
//vom Fly selbst berechnet und gesetzt.
if ( pFly->IsFlyAtCntFrm() ) if ( pFly->IsFlyAtCntFrm() )
((SwFlyAtCntFrm*)pFly)->SetAbsPos( rAbsPos ); ((SwFlyAtCntFrm*)pFly)->SetAbsPos( rAbsPos );
else else
...@@ -381,12 +379,12 @@ void SwFEShell::SetFlyPos( const Point& rAbsPos ) ...@@ -381,12 +379,12 @@ void SwFEShell::SetFlyPos( const Point& rAbsPos )
if ( pFly->IsFlyInCntFrm() ) if ( pFly->IsFlyInCntFrm() )
aOrient.X() = rAbsPos.X(); aOrient.X() = rAbsPos.X();
//RelPos errechnen. // calculate RelPos.
aOrient.X() = rAbsPos.X() - aOrient.X(); aOrient.X() = rAbsPos.X() - aOrient.X();
aOrient.Y() = rAbsPos.Y() - aOrient.Y(); aOrient.Y() = rAbsPos.Y() - aOrient.Y();
pFly->ChgRelPos( aOrient ); pFly->ChgRelPos( aOrient );
} }
CallChgLnk(); // rufe das AttrChangeNotify auf der UI-Seite. CallChgLnk(); // call the AttrChangeNotify on the UI-side.
} }
/************************************************************************* /*************************************************************************
...@@ -426,7 +424,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt ) ...@@ -426,7 +424,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
if( bFlyFrame ) if( bFlyFrame )
{ {
//Bezugspunkt in Dokumentkoordinaten bestimmen // Calculate reference point in document coordinates
SwCntntFrm *pCntnt = GetCurrFrm( sal_False ); SwCntntFrm *pCntnt = GetCurrFrm( sal_False );
if( !pCntnt ) if( !pCntnt )
return aRet; return aRet;
...@@ -452,8 +450,8 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt ) ...@@ -452,8 +450,8 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
pFooterOrHeader = pCntnt->FindFooterOrHeader(); pFooterOrHeader = pCntnt->FindFooterOrHeader();
} }
//Ausgehend von der linken oberen Ecke des Fly den // Search nearest SwFlyFrm starting from the upper-left corner
//dichtesten SwFlyFrm suchen. // of the fly
SwCntntFrm *pTxtFrm; SwCntntFrm *pTxtFrm;
{ {
SwCrsrMoveState aState( MV_SETONLYTEXT ); SwCrsrMoveState aState( MV_SETONLYTEXT );
...@@ -485,8 +483,8 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt ) ...@@ -485,8 +483,8 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
if( pNewAnch && !pNewAnch->IsProtected() ) if( pNewAnch && !pNewAnch->IsProtected() )
{ {
const SwFlyFrm* pCheck = bFlyFrame ? pNewAnch->FindFlyFrm() : 0; const SwFlyFrm* pCheck = bFlyFrame ? pNewAnch->FindFlyFrm() : 0;
// Falls wir innerhalb eines Rahmens landen, muss sichergestellt werden, // If we land inside the frame, make sure
// dass der Rahmen nicht in seinem eigenen Inhalt landet! // that the frame does not land inside its own content
while( pCheck ) while( pCheck )
{ {
if( pCheck == pFly ) if( pCheck == pFly )
...@@ -494,9 +492,9 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt ) ...@@ -494,9 +492,9 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
const SwFrm *pTmp = pCheck->GetAnchorFrm(); const SwFrm *pTmp = pCheck->GetAnchorFrm();
pCheck = pTmp ? pTmp->FindFlyFrm() : NULL; pCheck = pTmp ? pTmp->FindFlyFrm() : NULL;
} }
// Es darf nicht aus einer Kopf-/Fusszeile in einen anderen Bereich
// gewechselt werden, es darf nicht in eine Kopf-/Fusszeile hinein- // Do not switch from header/footer to another area,
// gewechselt werden. // do not switch to a header/footer
if( !pCheck && if( !pCheck &&
pFooterOrHeader == pNewAnch->FindFooterOrHeader() ) pFooterOrHeader == pNewAnch->FindFooterOrHeader() )
{ {
...@@ -596,7 +594,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt ) ...@@ -596,7 +594,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
/*********************************************************************** /***********************************************************************
#* Class : SwFEShell #* Class : SwFEShell
#* Methode : NewFlyFrm #* Methode : NewFlyFrm
#* Beschreibung: #* Description :
#***********************************************************************/ #***********************************************************************/
const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchValid, const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchValid,
...@@ -615,10 +613,10 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali ...@@ -615,10 +613,10 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
GetTblSel( *this, aBoxes ); GetTblSel( *this, aBoxes );
if( !aBoxes.empty() ) if( !aBoxes.empty() )
{ {
// die Crsr muessen noch aus dem Loeschbereich entfernt // Crsr should be removed from the removal area.
// werden. Setze sie immer hinter/auf die Tabelle; ueber die // Always put it after/on the table; via the
// Dokument-Position werden sie dann immer an die alte // document position they will be set to the old
// Position gesetzt. // position
ParkCrsr( SwNodeIndex( *aBoxes.begin()->second->GetSttNd() )); ParkCrsr( SwNodeIndex( *aBoxes.begin()->second->GetSttNd() ));
// #i127787# pCurCrsr will be deleted in ParkCrsr, // #i127787# pCurCrsr will be deleted in ParkCrsr,
...@@ -661,7 +659,7 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali ...@@ -661,7 +659,7 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
break; break;
default: default:
OSL_ENSURE( !this, "Was sollte das fuer ein Fly werden?" ); OSL_ENSURE( !this, "What is the purpose of this Fly?" );
break; break;
} }
...@@ -676,11 +674,10 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali ...@@ -676,11 +674,10 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
if ( FLY_AT_PAGE != eRndId ) if ( FLY_AT_PAGE != eRndId )
{ {
// erstmal als mit Seitenbindung, Absatz/Zeichenbindung erst wenn // First as with page link. Paragraph/character link on if
// alles verschoben ist. Dann ist die Position gueltig! // everything was shifted. Then the position is valid!
// JP 13.05.98: ggfs. auch noch die Hori/Vert-Orientierung // JP 13.05.98: if necessary also convert the horizontal/vertical
// umsetzen, damit diese beim Umanker NICHT // orientation, to prevent correction during re-anchoring
// korrigiert wird
pOldAnchor = new SwFmtAnchor( rAnch ); pOldAnchor = new SwFmtAnchor( rAnch );
const_cast<SfxItemSet&>(rSet).Put( SwFmtAnchor( FLY_AT_PAGE, 1 ) ); const_cast<SfxItemSet&>(rSet).Put( SwFmtAnchor( FLY_AT_PAGE, 1 ) );
...@@ -709,10 +706,9 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali ...@@ -709,10 +706,9 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
{ {
if( pRet ) if( pRet )
{ {
// neue Position bestimmen // calculate new position
//JP 24.03.97: immer ueber die Seitenbindung gehen - der // JP 24.03.97: also go via page links
// chaos::Anchor darf nie im verschobenen Bereich // chaos::anchor should not lie in the shifted area
// liegen
pRet->DelFrms(); pRet->DelFrms();
const SwFrm* pAnch = ::FindAnchor( GetLayout(), aPt, sal_False ); const SwFrm* pAnch = ::FindAnchor( GetLayout(), aPt, sal_False );
...@@ -723,9 +719,8 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali ...@@ -723,9 +719,8 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
} }
pOldAnchor->SetAnchor( &aPos ); pOldAnchor->SetAnchor( &aPos );
// das verschieben von TabelleSelektion ist noch nicht // shifting of table selection is not Undo-capable. therefore
// Undofaehig - also darf das UmAnkern auch nicht // changing the anchors should not be recorded
// aufgezeichnet werden.
bool const bDoesUndo = bool const bDoesUndo =
GetDoc()->GetIDocumentUndoRedo().DoesUndo(); GetDoc()->GetIDocumentUndoRedo().DoesUndo();
SwUndoId nLastUndoId(UNDO_EMPTY); SwUndoId nLastUndoId(UNDO_EMPTY);
...@@ -793,7 +788,7 @@ void SwFEShell::Insert( const String& rGrfName, const String& rFltName, ...@@ -793,7 +788,7 @@ void SwFEShell::Insert( const String& rGrfName, const String& rFltName,
SwShellCrsr *pCursor = pStartCursor; SwShellCrsr *pCursor = pStartCursor;
do { do {
// Anker noch nicht oder unvollstaendig gesetzt ? // Has the anchor not been set or been set incompletely?
if( pFlyAttrSet ) if( pFlyAttrSet )
{ {
const SfxPoolItem* pItem; const SfxPoolItem* pItem;
...@@ -846,7 +841,7 @@ void SwFEShell::Insert( const String& rGrfName, const String& rFltName, ...@@ -846,7 +841,7 @@ void SwFEShell::Insert( const String& rGrfName, const String& rFltName,
const Point aPt( GetCrsrDocPos() ); const Point aPt( GetCrsrDocPos() );
SwFlyFrm* pFrm = pFmt->GetFrm( &aPt ); SwFlyFrm* pFrm = pFmt->GetFrm( &aPt );
// Invalidate the content and layout to refresh the picture anchoring // fdo#36681: Invalidate the content and layout to refresh the picture anchoring
// properly // properly
SwPageFrm* pPageFrm = pFrm->FindPageFrmOfAnchor(); SwPageFrm* pPageFrm = pFrm->FindPageFrmOfAnchor();
pPageFrm->InvalidateFlyLayout(); pPageFrm->InvalidateFlyLayout();
...@@ -979,12 +974,13 @@ void SwFEShell::SetPageObjsNewPage( SvPtrarr& rFillArr, int nOffset ) ...@@ -979,12 +974,13 @@ void SwFEShell::SetPageObjsNewPage( SvPtrarr& rFillArr, int nOffset )
pFmt = (SwFrmFmt*)rFillArr[n]; pFmt = (SwFrmFmt*)rFillArr[n];
if( USHRT_MAX != pDoc->GetSpzFrmFmts()->GetPos( pFmt )) if( USHRT_MAX != pDoc->GetSpzFrmFmts()->GetPos( pFmt ))
{ {
// FlyFmt ist noch gueltig, also behandeln // FlyFmt is still valid, therefore process
SwFmtAnchor aNewAnchor( pFmt->GetAnchor() ); SwFmtAnchor aNewAnchor( pFmt->GetAnchor() );
if ((FLY_AT_PAGE != aNewAnchor.GetAnchorId()) || if ((FLY_AT_PAGE != aNewAnchor.GetAnchorId()) ||
0 >= ( nNewPage = aNewAnchor.GetPageNum() + nOffset ) ) 0 >= ( nNewPage = aNewAnchor.GetPageNum() + nOffset ) )
// chaos::Anchor wurde veraendert oder ungueltige SeitenNummer, // chaos::Anchor has been changed or invalid page number,
// also nicht veraendern !! // therefore: do not change!
continue; continue;
if( sal_uInt16(nNewPage) > nMaxPage ) if( sal_uInt16(nNewPage) > nMaxPage )
...@@ -1014,10 +1010,11 @@ void SwFEShell::SetPageObjsNewPage( SvPtrarr& rFillArr, int nOffset ) ...@@ -1014,10 +1010,11 @@ void SwFEShell::SetPageObjsNewPage( SvPtrarr& rFillArr, int nOffset )
/*********************************************************************** /***********************************************************************
#* Class : SwFEShell #* Class : SwFEShell
#* Methode : GetFlyFrmAttr #* Methode : GetFlyFrmAttr
#* Beschreibung: Alle Attribute in dem 'Koerbchen' werden mit den #* Description : all attributes in the "baskets" will be filled
#* Attributen des aktuellen FlyFrms gefuellt. #* with the attributes of the current FlyFrms.
#* Sind Attribute nicht zu fuellen weil fehl am Platz oder #* Attributes which cannot be filled due to being at the wrong place
#* uneindeutig (Mehrfachtselektionen) so werden sie entfernt. #* or which are ambiguous (multiple selections) will be removed.
#*
#***********************************************************************/ #***********************************************************************/
sal_Bool SwFEShell::GetFlyFrmAttr( SfxItemSet &rSet ) const sal_Bool SwFEShell::GetFlyFrmAttr( SfxItemSet &rSet ) const
...@@ -1044,8 +1041,8 @@ sal_Bool SwFEShell::GetFlyFrmAttr( SfxItemSet &rSet ) const ...@@ -1044,8 +1041,8 @@ sal_Bool SwFEShell::GetFlyFrmAttr( SfxItemSet &rSet ) const
if( !rSet.Set( pFly->GetFmt()->GetAttrSet(), sal_True ) ) if( !rSet.Set( pFly->GetFmt()->GetAttrSet(), sal_True ) )
return sal_False; return sal_False;
//Und die Attribute durchschaufeln. Unerlaubte Attribute entfernen, dann // now examine all attributes. Remove forbidden attributes, then
//alle restlichen Attribute besorgen und eintragen. // get all remaining attributes and enter them
const SfxPoolItem* pItem; const SfxPoolItem* pItem;
if( SFX_ITEM_SET == rSet.GetItemState( RES_ANCHOR, sal_False, &pItem ) ) if( SFX_ITEM_SET == rSet.GetItemState( RES_ANCHOR, sal_False, &pItem ) )
{ {
...@@ -1064,17 +1061,17 @@ sal_Bool SwFEShell::GetFlyFrmAttr( SfxItemSet &rSet ) const ...@@ -1064,17 +1061,17 @@ sal_Bool SwFEShell::GetFlyFrmAttr( SfxItemSet &rSet ) const
} }
} }
rSet.SetParent( pFly->GetFmt()->GetAttrSet().GetParent() ); rSet.SetParent( pFly->GetFmt()->GetAttrSet().GetParent() );
// die Attribute MUESSEN entfern werden! // attributes must be removed
rSet.ClearItem( RES_FILL_ORDER ); rSet.ClearItem( RES_FILL_ORDER );
rSet.ClearItem( RES_CNTNT ); rSet.ClearItem( RES_CNTNT );
//MA: Ersteinmal entfernen (Template by example usw.) //MA: remove first (Template by example etc.)
rSet.ClearItem( RES_CHAIN ); rSet.ClearItem( RES_CHAIN );
return sal_True; return sal_True;
} }
/*********************************************************************** /***********************************************************************
#* Class : SwFEShell #* Class : SwFEShell
#* Methode : SetFlyFrmAttr #* Methode : SetFlyFrmAttr
#* Beschreibung: Die Attribute des aktuellen Flys aendern sich. #* Description : Attributes of the current fly will change.
#***********************************************************************/ #***********************************************************************/
sal_Bool SwFEShell::SetFlyFrmAttr( SfxItemSet& rSet ) sal_Bool SwFEShell::SetFlyFrmAttr( SfxItemSet& rSet )
...@@ -1159,8 +1156,8 @@ sal_Bool SwFEShell::SetDrawingAttr( SfxItemSet& rSet ) ...@@ -1159,8 +1156,8 @@ sal_Bool SwFEShell::SetDrawingAttr( SfxItemSet& rSet )
/*********************************************************************** /***********************************************************************
#* Class : SwFEShell #* Class : SwFEShell
#* Methode : ResetFlyFrmAttr #* Methode : ResetFlyFrmAttr
#* Beschreibung: Das gewuenschte Attribut oder die im Set befindlichen #* Description : Reset requested attributes or the ones contained in
#* werden zurueckgesetzt. #* the set.
#***********************************************************************/ #***********************************************************************/
sal_Bool SwFEShell::ResetFlyFrmAttr( sal_uInt16 nWhich, const SfxItemSet* pSet ) sal_Bool SwFEShell::ResetFlyFrmAttr( sal_uInt16 nWhich, const SfxItemSet* pSet )
...@@ -1210,7 +1207,7 @@ sal_Bool SwFEShell::ResetFlyFrmAttr( sal_uInt16 nWhich, const SfxItemSet* pSet ) ...@@ -1210,7 +1207,7 @@ sal_Bool SwFEShell::ResetFlyFrmAttr( sal_uInt16 nWhich, const SfxItemSet* pSet )
/*********************************************************************** /***********************************************************************
#* Class : SwFEShell #* Class : SwFEShell
#* Methode : GetCurFrmFmt #* Methode : GetCurFrmFmt
#* Beschreibung: liefert wenn Rahmen, dann Rahmenvorlage, sonst 0 #* Description : Returns frame-format if frame, otherwise 0
#***********************************************************************/ #***********************************************************************/
SwFrmFmt* SwFEShell::GetCurFrmFmt() const SwFrmFmt* SwFEShell::GetCurFrmFmt() const
...@@ -1225,7 +1222,7 @@ SwFrmFmt* SwFEShell::GetCurFrmFmt() const ...@@ -1225,7 +1222,7 @@ SwFrmFmt* SwFEShell::GetCurFrmFmt() const
/****************************************************************************** /******************************************************************************
* Methode : void SwFEShell::SetFrmFmt(SwFrmFmt *pNewFmt) * Methode : void SwFEShell::SetFrmFmt(SwFrmFmt *pNewFmt)
* Beschreibung: * Description :
******************************************************************************/ ******************************************************************************/
void SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, sal_Bool bKeepOrient, Point* pDocPos ) void SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, sal_Bool bKeepOrient, Point* pDocPos )
...@@ -1240,7 +1237,7 @@ void SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, sal_Bool bKeepOrient, Point* pDocP ...@@ -1240,7 +1237,7 @@ void SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, sal_Bool bKeepOrient, Point* pDocP
} }
else else
pFly = FindFlyFrm(); pFly = FindFlyFrm();
OSL_ENSURE( pFly, "SetFrmFmt: kein Frame" ); OSL_ENSURE( pFly, "SetFrmFmt: no frame" );
if( pFly ) if( pFly )
{ {
StartAllAction(); StartAllAction();
...@@ -1346,7 +1343,7 @@ void SwFEShell::SetObjRect( const SwRect& rRect ) ...@@ -1346,7 +1343,7 @@ void SwFEShell::SetObjRect( const SwRect& rRect )
if ( Imp()->HasDrawView() ) if ( Imp()->HasDrawView() )
{ {
Imp()->GetDrawView()->SetAllMarkedRect( rRect.SVRect() ); Imp()->GetDrawView()->SetAllMarkedRect( rRect.SVRect() );
CallChgLnk(); // rufe das AttrChangeNotify auf der UI-Seite. CallChgLnk(); // call AttrChangeNotify on the UI-side.
} }
} }
...@@ -1373,11 +1370,11 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference < ...@@ -1373,11 +1370,11 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference <
StartAllAction(); StartAllAction();
//MA wir lassen den Fly nicht Clippen, damit die Ole-Server mit // MA we do not allow to clip the Fly, as the OLE server can
//beliebigen Wuenschen kommen koennen. Die Formatierung uebernimmt das // request various wishes. Clipping is done via the formatting.
//Clippen. Die richtige Darstellung wird per Scalierung erledigt. // Correct display is done by scaling.
//Die Scalierung wird von SwNoTxtFrm::Format durch einen Aufruf von // Scaling is done by SwNoTxtFrm::Format by calling
//SwWrtShell::CalcAndSetScale() erledigt. // SwWrtShell::CalcAndSetScale()
if ( rRect.SSize() != pFly->Prt().SSize() && !bSizeProt ) if ( rRect.SSize() != pFly->Prt().SSize() && !bSizeProt )
{ {
Size aSz( rRect.SSize() ); Size aSz( rRect.SSize() );
...@@ -1421,7 +1418,7 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference < ...@@ -1421,7 +1418,7 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference <
if( Abs( aNewSz.Height() - pChgFly->Frm().Height()) > 1 ) if( Abs( aNewSz.Height() - pChgFly->Frm().Height()) > 1 )
aFrmSz.SetHeight( aNewSz.Height() ); aFrmSz.SetHeight( aNewSz.Height() );
} }
// uebers Doc fuers Undo! // via Doc for the Undo!
pFmt->GetDoc()->SetAttr( aFrmSz, *pFmt ); pFmt->GetDoc()->SetAttr( aFrmSz, *pFmt );
break; break;
} }
...@@ -1435,16 +1432,16 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference < ...@@ -1435,16 +1432,16 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference <
} }
aResult = pFly->ChgSize( aSz ); aResult = pFly->ChgSize( aSz );
//Wenn sich das Objekt aendert ist die Kontur hoechstwahrscheinlich daneben. // if the object changes, the contour is outside the object
OSL_ENSURE( pFly->Lower()->IsNoTxtFrm(), "Request ohne NoTxt" ); OSL_ENSURE( pFly->Lower()->IsNoTxtFrm(), "Request without NoTxt" );
SwNoTxtNode *pNd = ((SwCntntFrm*)pFly->Lower())->GetNode()->GetNoTxtNode(); SwNoTxtNode *pNd = ((SwCntntFrm*)pFly->Lower())->GetNode()->GetNoTxtNode();
OSL_ENSURE( pNd, "Request ohne Node" ); OSL_ENSURE( pNd, "Request without Node" );
pNd->SetContour( 0 ); pNd->SetContour( 0 );
ClrContourCache(); ClrContourCache();
} }
//Wenn nur die Size angepasst werden soll, so wird eine Pos mit // if only the size is to be adjusted, a position is transported with
//ausgezeichneten Werten transportiert. // allocated values
Point aPt( pFly->Prt().Pos() ); Point aPt( pFly->Prt().Pos() );
aPt += pFly->Frm().Pos(); aPt += pFly->Frm().Pos();
if ( rRect.Top() != LONG_MIN && rRect.Pos() != aPt && !bPosProt ) if ( rRect.Top() != LONG_MIN && rRect.Pos() != aPt && !bPosProt )
...@@ -1452,9 +1449,10 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference < ...@@ -1452,9 +1449,10 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference <
aPt = rRect.Pos(); aPt = rRect.Pos();
aPt.X() -= pFly->Prt().Left(); aPt.X() -= pFly->Prt().Left();
aPt.Y() -= pFly->Prt().Top(); aPt.Y() -= pFly->Prt().Top();
//Bei Absatzgebundenen Flys muss ausgehend von der neuen Position ein
//neuer Anker gesetzt werden. Anker und neue RelPos werden vom Fly // in case of paragraph-bound Flys, starting from the new position,
//selbst berechnet und gesetzt. // a new anchor is to be set. The anchor and the new RelPos are
// calculated by the Fly and set
if( pFly->IsFlyAtCntFrm() ) if( pFly->IsFlyAtCntFrm() )
((SwFlyAtCntFrm*)pFly)->SetAbsPos( aPt ); ((SwFlyAtCntFrm*)pFly)->SetAbsPos( aPt );
else else
...@@ -1488,15 +1486,15 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference < ...@@ -1488,15 +1486,15 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference <
SwFrmFmt* SwFEShell::WizzardGetFly() SwFrmFmt* SwFEShell::WizzardGetFly()
{ {
// mal nicht uebers Layout den Fly suchen. Dann kann auch ohne gueltiges // do not search the Fly via the layout. Now we can delete a frame
// Layout ein Rahmen geloescht werden. ( z.B.: fuer die Wizard's ) // without a valid layout. ( e.g. for the wizards )
SwSpzFrmFmts& rSpzArr = *pDoc->GetSpzFrmFmts(); SwSpzFrmFmts& rSpzArr = *pDoc->GetSpzFrmFmts();
sal_uInt16 nCnt = rSpzArr.Count(); sal_uInt16 nCnt = rSpzArr.Count();
if( nCnt ) if( nCnt )
{ {
SwNodeIndex& rCrsrNd = GetCrsr()->GetPoint()->nNode; SwNodeIndex& rCrsrNd = GetCrsr()->GetPoint()->nNode;
if( rCrsrNd.GetIndex() > pDoc->GetNodes().GetEndOfExtras().GetIndex() ) if( rCrsrNd.GetIndex() > pDoc->GetNodes().GetEndOfExtras().GetIndex() )
// Cusor steht im Body-Bereich! // Cursor is in the body area!
return 0; return 0;
for( sal_uInt16 n = 0; n < nCnt; ++n ) for( sal_uInt16 n = 0; n < nCnt; ++n )
...@@ -1509,7 +1507,7 @@ SwFrmFmt* SwFEShell::WizzardGetFly() ...@@ -1509,7 +1507,7 @@ SwFrmFmt* SwFEShell::WizzardGetFly()
pSttNd->GetIndex() < rCrsrNd.GetIndex() && pSttNd->GetIndex() < rCrsrNd.GetIndex() &&
rCrsrNd.GetIndex() < pSttNd->EndOfSectionIndex() ) rCrsrNd.GetIndex() < pSttNd->EndOfSectionIndex() )
{ {
// gefunden: also raus damit // found: return immediately
return pFmt; return pFmt;
} }
} }
...@@ -1523,7 +1521,7 @@ void SwFEShell::SetFlyName( const String& rName ) ...@@ -1523,7 +1521,7 @@ void SwFEShell::SetFlyName( const String& rName )
if( pFly ) if( pFly )
GetDoc()->SetFlyName( *(SwFlyFrmFmt*)pFly->GetFmt(), rName ); GetDoc()->SetFlyName( *(SwFlyFrmFmt*)pFly->GetFmt(), rName );
else { else {
OSL_ENSURE( !this, "kein FlyFrame selektiert" ); OSL_ENSURE( !this, "no FlyFrame selected" );
} }
} }
...@@ -1533,7 +1531,7 @@ const String& SwFEShell::GetFlyName() const ...@@ -1533,7 +1531,7 @@ const String& SwFEShell::GetFlyName() const
if( pFly ) if( pFly )
return pFly->GetFmt()->GetName(); return pFly->GetFmt()->GetName();
OSL_ENSURE( !this, "kein FlyFrame selektiert" ); OSL_ENSURE( !this, "no FlyFrame selected" );
return aEmptyStr; return aEmptyStr;
} }
...@@ -1608,10 +1606,10 @@ const SwFrmFmt* SwFEShell::IsURLGrfAtPos( const Point& rPt, String* pURL, ...@@ -1608,10 +1606,10 @@ const SwFrmFmt* SwFEShell::IsURLGrfAtPos( const Point& rPt, String* pURL,
*pURL = rURL.GetURL(); *pURL = rURL.GetURL();
if( rURL.IsServerMap() ) if( rURL.IsServerMap() )
{ {
// dann die rel. Pixel Position anhaengen !! // append the relative pixel position !!
Point aPt( rPt ); Point aPt( rPt );
aPt -= pFly->Frm().Pos(); aPt -= pFly->Frm().Pos();
// ohne MapMode-Offset, ohne Offset, o ... !!!!! // without MapMode-Offset, without Offset, o ... !!!!!
aPt = GetOut()->LogicToPixel( aPt = GetOut()->LogicToPixel(
aPt, MapMode( MAP_TWIP ) ); aPt, MapMode( MAP_TWIP ) );
((( *pURL += '?' ) += String::CreateFromInt32( aPt.X() )) ((( *pURL += '?' ) += String::CreateFromInt32( aPt.X() ))
...@@ -1650,7 +1648,7 @@ const Graphic *SwFEShell::GetGrfAtPos( const Point &rPt, ...@@ -1650,7 +1648,7 @@ const Graphic *SwFEShell::GetGrfAtPos( const Point &rPt,
{ {
if ( pNd->IsGrfLink() ) if ( pNd->IsGrfLink() )
{ {
//Halbfertige Grafik? // halfway ready graphic?
::sfx2::SvLinkSource* pLnkObj = pNd->GetLink()->GetObj(); ::sfx2::SvLinkSource* pLnkObj = pNd->GetLink()->GetObj();
if( pLnkObj && pLnkObj->IsPending() ) if( pLnkObj && pLnkObj->IsPending() )
return 0; return 0;
...@@ -1681,15 +1679,15 @@ const SwFrmFmt* SwFEShell::GetFmtFromObj( const Point& rPt, SwRect** pRectToFill ...@@ -1681,15 +1679,15 @@ const SwFrmFmt* SwFEShell::GetFmtFromObj( const Point& rPt, SwRect** pRectToFill
SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView(); SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView();
sal_uInt16 nOld = pDView->GetHitTolerancePixel(); sal_uInt16 nOld = pDView->GetHitTolerancePixel();
// Tattergrenze fuer Drawing-SS // tolerance for Drawing-SS
pDView->SetHitTolerancePixel( pDView->GetMarkHdlSizePixel()/2 ); pDView->SetHitTolerancePixel( pDView->GetMarkHdlSizePixel()/2 );
if( pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPView, SDRSEARCH_PICKMARKABLE ) ) if( pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPView, SDRSEARCH_PICKMARKABLE ) )
{ {
// dann teste mal was es ist: // first check it:
if ( pObj->ISA(SwVirtFlyDrawObj) ) if ( pObj->ISA(SwVirtFlyDrawObj) )
pRet = ((SwVirtFlyDrawObj*)pObj)->GetFmt(); pRet = ((SwVirtFlyDrawObj*)pObj)->GetFmt();
else if ( pObj->GetUserCall() ) //nicht fuer Gruppenobjekte else if ( pObj->GetUserCall() ) //not for group objects
pRet = ((SwDrawContact*)pObj->GetUserCall())->GetFmt(); pRet = ((SwDrawContact*)pObj->GetUserCall())->GetFmt();
if(pRet && pRectToFill) if(pRet && pRectToFill)
**pRectToFill = pObj->GetCurrentBoundRect(); **pRectToFill = pObj->GetCurrentBoundRect();
...@@ -1805,7 +1803,7 @@ ObjCntType SwFEShell::GetObjCntType( const Point &rPt, SdrObject *&rpObj ) const ...@@ -1805,7 +1803,7 @@ ObjCntType SwFEShell::GetObjCntType( const Point &rPt, SdrObject *&rpObj ) const
SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView(); SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView();
sal_uInt16 nOld = pDView->GetHitTolerancePixel(); sal_uInt16 nOld = pDView->GetHitTolerancePixel();
// Tattergrenze fuer Drawing-SS // tolerance for Drawing-SS
pDView->SetHitTolerancePixel( pDView->GetMarkHdlSizePixel()/2 ); pDView->SetHitTolerancePixel( pDView->GetMarkHdlSizePixel()/2 );
if( pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPView, SDRSEARCH_PICKMARKABLE ) ) if( pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPView, SDRSEARCH_PICKMARKABLE ) )
...@@ -1837,7 +1835,7 @@ ObjCntType SwFEShell::GetObjCntTypeOfSelection( SdrObject** ppObj ) const ...@@ -1837,7 +1835,7 @@ ObjCntType SwFEShell::GetObjCntTypeOfSelection( SdrObject** ppObj ) const
else if( eTmp != eType ) else if( eTmp != eType )
{ {
eType = OBJCNT_DONTCARE; eType = OBJCNT_DONTCARE;
// einmal DontCare, immer DontCare! // once DontCare, always DontCare!
break; break;
} }
} }
...@@ -1859,15 +1857,15 @@ sal_Bool SwFEShell::ReplaceSdrObj( const String& rGrfName, const String& rFltNam ...@@ -1859,15 +1857,15 @@ sal_Bool SwFEShell::ReplaceSdrObj( const String& rGrfName, const String& rFltNam
SdrObject* pObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj(); SdrObject* pObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj();
SwFrmFmt *pFmt = FindFrmFmt( pObj ); SwFrmFmt *pFmt = FindFrmFmt( pObj );
// Attribute sichern und dann an der Grafik setzen // store attributes, then set the graphic
SfxItemSet aFrmSet( pDoc->GetAttrPool(), SfxItemSet aFrmSet( pDoc->GetAttrPool(),
pFmt->GetAttrSet().GetRanges() ); pFmt->GetAttrSet().GetRanges() );
aFrmSet.Set( pFmt->GetAttrSet() ); aFrmSet.Set( pFmt->GetAttrSet() );
// Groesse und Position setzen ?? // set size and position?
if( !pObj->ISA(SwVirtFlyDrawObj) ) if( !pObj->ISA(SwVirtFlyDrawObj) )
{ {
// dann mal los: // then let's do it:
const Rectangle &rBound = pObj->GetSnapRect(); const Rectangle &rBound = pObj->GetSnapRect();
Point aRelPos( pObj->GetRelativePos() ); Point aRelPos( pObj->GetRelativePos() );
...@@ -1890,7 +1888,7 @@ sal_Bool SwFEShell::ReplaceSdrObj( const String& rGrfName, const String& rFltNam ...@@ -1890,7 +1888,7 @@ sal_Bool SwFEShell::ReplaceSdrObj( const String& rGrfName, const String& rFltNam
StartAllAction(); StartAllAction();
StartUndo(); StartUndo();
// das "Sdr-Object" loeschen und dafuer die Grafik einfuegen // delete "Sdr-Object", insert the graphic instead
DelSelectedObj(); DelSelectedObj();
pFmt = GetDoc()->Insert( *GetCrsr(), rGrfName, rFltName, pGrf, &aFrmSet, NULL, NULL ); pFmt = GetDoc()->Insert( *GetCrsr(), rGrfName, rFltName, pGrf, &aFrmSet, NULL, NULL );
......
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