From f01d8a28bae15a8c6b86d89c4a372779f261dd67 Mon Sep 17 00:00:00 2001 From: os Date: Tue, 22 Mar 2011 15:32:53 +0100 Subject: #i105244# handling of extensions while saving pictures fixed --- sw/source/ui/docvw/romenu.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 sw/source/ui/docvw/romenu.cxx diff --git a/sw/source/ui/docvw/romenu.cxx b/sw/source/ui/docvw/romenu.cxx old mode 100644 new mode 100755 index a9c6c29c6b..4983db601b --- 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; } } -- cgit v1.2.3 From 1f5e97cbab7362019d86d59b62b72e255dc662ee Mon Sep 17 00:00:00 2001 From: os Date: Wed, 23 Mar 2011 07:52:55 +0100 Subject: #i114045# return from page preview: go to the right document position --- sw/source/ui/inc/view.hxx | 1 + sw/source/ui/uiview/view.cxx | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) mode change 100644 => 100755 sw/source/ui/inc/view.hxx mode change 100644 => 100755 sw/source/ui/uiview/view.cxx diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx old mode 100644 new mode 100755 index f4a11ccdfd..a70809e336 --- 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 old mode 100644 new mode 100755 index b1c8911c86..55196d8f36 --- 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 , @@ -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 ); -- cgit v1.2.3 From 3a2b2870a320aeb751e22d2ccf86b3d401f50495 Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Wed, 23 Mar 2011 10:24:41 +0100 Subject: os151: #i102707# - method - restoration of map mode only if needed and special handling during meta file creation --- sw/source/core/draw/dflyobj.cxx | 66 ++++++++++++++++++++++++++++++++++------- 1 file changed, 55 insertions(+), 11 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 , 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() ); } } } -- cgit v1.2.3 From b5b51f0fb63594c5650bfd03986e11a258d75ba3 Mon Sep 17 00:00:00 2001 From: os Date: Wed, 23 Mar 2011 12:20:23 +0100 Subject: os151: #108521# mark table cells as modified when pasting content unformatted, RTF or HTML --- sw/source/ui/dochdl/swdtflvr.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index 3fd11d5dfc..1b87d3f480 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -1688,7 +1688,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 -- cgit v1.2.3 From 75f911491afdb9c5dfa7b8fe486911e0952f3867 Mon Sep 17 00:00:00 2001 From: os Date: Wed, 23 Mar 2011 15:35:29 +0100 Subject: os151: #i116136# prevent reset of 'modified' flag while sending to outline or clipboard --- sw/source/ui/app/docsh2.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index 6d300d2f7d..3783458f62 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -1109,6 +1109,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 ); @@ -1116,6 +1118,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 ); -- cgit v1.2.3 From be2ee939bbe4d211edf42c924b43c38ba128cd7e Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Fri, 25 Mar 2011 12:18:37 +0100 Subject: os151: #i98753# - method - set size of embedded object at the object description structure --- sw/source/ui/dochdl/swdtflvr.cxx | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) mode change 100644 => 100755 sw/source/ui/dochdl/swdtflvr.cxx diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx old mode 100644 new mode 100755 index 1b87d3f480..c168104b2b --- 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 ); -- cgit v1.2.3