summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2011-04-01 10:26:03 +0200
committerIvo Hinkelmann <ihi@openoffice.org>2011-04-01 10:26:03 +0200
commit99796d2482c2931a1023b8230a3f6b18d1f48ebf (patch)
tree3358c69c242cfcf79a7b8dc2bee9012a4d67331b
parent21d7b66729b013c2d29bccb0677a6941234b04ae (diff)
parent443675c34ff1ea349a6c68601b7f3bd27529f614 (diff)
CWS-TOOLING: integrate CWS os151
Notes
split repo tag: writer_ooo/DEV300_m106
-rw-r--r--sw/source/core/draw/dflyobj.cxx66
-rwxr-xr-xsw/source/ui/app/docsh2.cxx3
-rwxr-xr-x[-rw-r--r--]sw/source/ui/dochdl/swdtflvr.cxx24
-rwxr-xr-x[-rw-r--r--]sw/source/ui/docvw/romenu.cxx4
-rwxr-xr-x[-rw-r--r--]sw/source/ui/inc/view.hxx1
-rwxr-xr-x[-rw-r--r--]sw/source/ui/uiview/view.cxx6
6 files changed, 71 insertions, 33 deletions
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 73616b18fc36..1fac4a1634a7 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 068ea736db3e..311d22271767 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 1c9caac9b5e2..c12b4a9e7878 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 681eab61dee9..a50d89f7bb30 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 bbf32cdea482..61d4d4b8702c 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 2d392b4658ad..de524dd2706a 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 );