Kaydet (Commit) 99796d24 authored tarafından Ivo Hinkelmann's avatar Ivo Hinkelmann

CWS-TOOLING: integrate CWS os151

......@@ -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() );
}
}
}
......
......@@ -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 );
......
......@@ -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
......
......@@ -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;
}
}
......
......@@ -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
;
......
......@@ -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 );
......
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