diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2011-04-01 10:26:03 +0200 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2011-04-01 10:26:03 +0200 |
commit | d9c342f89f8007499f4d5b8f2f1f91d1a25de52a (patch) | |
tree | 10c030b333fe8d7e6a1d7295a8df4b5f5b55242c | |
parent | 79391c1069ed96f762afc289aa07ffbe9ab9a8ab (diff) | |
parent | be2ee939bbe4d211edf42c924b43c38ba128cd7e (diff) |
CWS-TOOLING: integrate CWS os151ooo/DEV300_m106
-rw-r--r-- | sw/source/core/draw/dflyobj.cxx | 66 | ||||
-rwxr-xr-x | sw/source/ui/app/docsh2.cxx | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | sw/source/ui/dochdl/swdtflvr.cxx | 24 | ||||
-rwxr-xr-x[-rw-r--r--] | sw/source/ui/docvw/romenu.cxx | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | sw/source/ui/inc/view.hxx | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | sw/source/ui/uiview/view.cxx | 6 |
6 files changed, 71 insertions, 33 deletions
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 7495a1523d..b937d3dad9 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -473,6 +473,52 @@ SwFrmFmt *SwVirtFlyDrawObj::GetFmt() |* *************************************************************************/ +// --> OD #i102707# +namespace +{ + class RestoreMapMode + { + public: + explicit RestoreMapMode( ViewShell* pViewShell ) + : mbMapModeRestored( false ) + , mpOutDev( pViewShell->GetOut() ) + { + if ( pViewShell->getPrePostMapMode() != mpOutDev->GetMapMode() ) + { + mpOutDev->Push(PUSH_MAPMODE); + + GDIMetaFile* pMetaFile = mpOutDev->GetConnectMetaFile(); + if ( pMetaFile && + pMetaFile->IsRecord() && !pMetaFile->IsPause() ) + { + ASSERT( false, + "MapMode restoration during meta file creation is somehow suspect - using <SetRelativeMapMode(..)>, but not sure, if correct." ) + mpOutDev->SetRelativeMapMode( pViewShell->getPrePostMapMode() ); + } + else + { + mpOutDev->SetMapMode( pViewShell->getPrePostMapMode() ); + } + + mbMapModeRestored = true; + } + }; + + ~RestoreMapMode() + { + if ( mbMapModeRestored ) + { + mpOutDev->Pop(); + } + }; + + private: + bool mbMapModeRestored; + OutputDevice* mpOutDev; + }; +} +// <-- + void SwVirtFlyDrawObj::wrap_DoPaintObject() const { ViewShell* pShell = pFlyFrm->getRootFrm()->GetCurrShell(); @@ -482,31 +528,29 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject() const // but no paints. IsPaintInProgress() depends on SW repaint, so, as long // as SW paints self and calls DrawLayer() for Heaven and Hell, this will // be correct - if(pShell && pShell->IsDrawingLayerPaintInProgress()) + if ( pShell && pShell->IsDrawingLayerPaintInProgress() ) { sal_Bool bDrawObject(sal_True); - if(!SwFlyFrm::IsPaint((SdrObject*)this, pShell)) + if ( !SwFlyFrm::IsPaint( (SdrObject*)this, pShell ) ) { bDrawObject = sal_False; } - if(bDrawObject) + if ( bDrawObject ) { - if(!pFlyFrm->IsFlyInCntFrm()) + if ( !pFlyFrm->IsFlyInCntFrm() ) { // it is also necessary to restore the VCL MapMode from ViewInformation since e.g. // the VCL PixelRenderer resets it at the used OutputDevice. Unfortunately, this // excludes shears and rotates which are not expressable in MapMode. - OutputDevice* pOut = pShell->GetOut(); - - pOut->Push(PUSH_MAPMODE); - pOut->SetMapMode(pShell->getPrePostMapMode()); + // OD #i102707# + // new helper class to restore MapMode - restoration, only if + // needed and consideration of paint for meta file creation . + RestoreMapMode aRestoreMapModeIfNeeded( pShell ); // paint the FlyFrame (use standard VCL-Paint) - pFlyFrm->Paint(GetFlyFrm()->Frm()); - - pOut->Pop(); + pFlyFrm->Paint( GetFlyFrm()->Frm() ); } } } diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index e5ea67a2b0..1c2d3d58bc 100755 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -1113,6 +1113,8 @@ void SwDocShell::Execute(SfxRequest& rReq) case FN_OUTLINE_TO_CLIPBOARD: case FN_OUTLINE_TO_IMPRESS: { + sal_Bool bEnable = IsEnableSetModified(); + EnableSetModified( sal_False ); WriterRef xWrt; // mba: looks as if relative URLs don't make sense here ::GetRTFWriter( 'O', String(), xWrt ); @@ -1120,6 +1122,7 @@ void SwDocShell::Execute(SfxRequest& rReq) pStrm->SetBufferSize( 16348 ); SwWriter aWrt( *pStrm, *GetDoc() ); ErrCode eErr = aWrt.Write( xWrt ); + EnableSetModified( bEnable ); if( !ERRCODE_TOERROR( eErr ) ) { pStrm->Seek( STREAM_SEEK_TO_END ); diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index 3fd11d5dfc..c168104b2b 100644..100755 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -154,24 +154,6 @@ using namespace nsTransferBufferType; #define DDE_TXT_ENCODING gsl_getSystemTextEncoding() -//--------------------------------------------- -// this struct conforms to the Microsoft -// OBJECTDESCRIPTOR -> see oleidl.h -// (MS platform sdk) -//--------------------------------------------- - -struct OleObjectDescriptor -{ - sal_uInt32 cbSize; - ClsId clsid; - sal_uInt32 dwDrawAspect; - Size sizel; - Point pointl; - sal_uInt32 dwStatus; - sal_uInt32 dwFullUserTypeName; - sal_uInt32 dwSrcOfCopy; -}; - class SwTrnsfrDdeLink : public ::sfx2::SvBaseLink { String sName; @@ -831,6 +813,10 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut ) AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE ); + // --> OD #i98753# + // set size of embedded object at the object description structure + aObjDesc.maSize = OutputDevice::LogicToLogic( pWrtShell->GetObjSize(), MAP_TWIP, MAP_100TH_MM ); + // <-- PrepareOLE( aObjDesc ); AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); @@ -1688,7 +1674,9 @@ int SwTransferable::_PasteFileContent( TransferableDataHelper& rData, Link aOldLink( rSh.GetChgLnk() ); rSh.SetChgLnk( Link() ); + const SwPosition& rInsPos = *rSh.GetCrsr()->Start(); SwReader aReader( *pStream, aEmptyStr, String(), *rSh.GetCrsr() ); + rSh.SaveTblBoxCntnt( &rInsPos ); if( IsError( aReader.Read( *pRead )) ) nResId = ERR_CLPBRD_READ; else diff --git a/sw/source/ui/docvw/romenu.cxx b/sw/source/ui/docvw/romenu.cxx index a9c6c29c6b..4983db601b 100644..100755 --- a/sw/source/ui/docvw/romenu.cxx +++ b/sw/source/ui/docvw/romenu.cxx @@ -424,7 +424,7 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName ) SvtPathOptions aPathOpt; String sGrfPath( aPathOpt.GetGraphicPath() ); - FileDialogHelper aDlgHelper( TemplateDescription::FILESAVE_SIMPLE, 0 ); + FileDialogHelper aDlgHelper( TemplateDescription::FILESAVE_AUTOEXTENSION, 0 ); Reference < XFilePicker > xFP = aDlgHelper.GetFilePicker(); // aExpDlg.SetHelpId(HID_FILEDLG_ROMENU); @@ -512,7 +512,7 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName ) nFilter = GRFILTER_FORMAT_DONTKNOW; String aFilter( rGF.GetExportFormatShortName( nFilter ) ); XOutBitmap::WriteGraphic( rGraphic, sPath, aFilter, - XOUTBMP_DONT_EXPAND_FILENAME ); + XOUTBMP_DONT_EXPAND_FILENAME|XOUTBMP_DONT_ADD_EXTENSION ); return sPath; } } diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx index f4a11ccdfd..a70809e336 100644..100755 --- a/sw/source/ui/inc/view.hxx +++ b/sw/source/ui/inc/view.hxx @@ -284,6 +284,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell bInMailMerge : 1, bInDtor : 1, //detect destructor to prevent creating of sub shells while closing bOldShellWasPagePreView : 1, + bIsPreviewDoubleClick : 1, // #i114045# bMakeSelectionVisible : 1 // #b6330459# transport the bookmark selection ; diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index b1c8911c86..55196d8f36 100644..100755 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -787,7 +787,8 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) nRightBorderDistance( 0 ), bInMailMerge(sal_False), bInDtor(sal_False), - bOldShellWasPagePreView(sal_False) + bOldShellWasPagePreView(sal_False), + bIsPreviewDoubleClick(sal_False) { // OD 18.12.2002 #103492# - According to discussion with MBA and further // investigations, no old SfxViewShell will be set as parameter <pOldSh>, @@ -844,6 +845,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) sNewCrsrPos = ((SwPagePreView*)pExistingSh)->GetNewCrsrPos(); nNewPage = ((SwPagePreView*)pExistingSh)->GetNewPage(); bOldShellWasPagePreView = sal_True; + bIsPreviewDoubleClick = sNewCrsrPos.Len() > 0 || nNewPage != USHRT_MAX; } else if( pExistingSh->IsA( TYPE( SwSrcView ) ) ) bOldShellWasSrcView = sal_True; @@ -1292,7 +1294,7 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse ) void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >& rSequence, sal_Bool bBrowse ) { - if(GetDocShell()->IsPreview()) + if(GetDocShell()->IsPreview()||bIsPreviewDoubleClick) return; //#i43146# go to the last editing position when opening own files bool bIsOwnDocument = lcl_IsOwnDocument( *this ); |