You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2013/10/10 18:20:50 UTC
svn commit: r1531041 - in /openoffice/trunk/main/sc/source/ui:
app/transobj.cxx inc/transobj.hxx
Author: alg
Date: Thu Oct 10 16:20:50 2013
New Revision: 1531041
URL: http://svn.apache.org/r1531041
Log:
i123405 Allow to not limit size to PageSize when creating Metafile content
Modified:
openoffice/trunk/main/sc/source/ui/app/transobj.cxx
openoffice/trunk/main/sc/source/ui/inc/transobj.hxx
Modified: openoffice/trunk/main/sc/source/ui/app/transobj.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sc/source/ui/app/transobj.cxx?rev=1531041&r1=1531040&r2=1531041&view=diff
==============================================================================
--- openoffice/trunk/main/sc/source/ui/app/transobj.cxx (original)
+++ openoffice/trunk/main/sc/source/ui/app/transobj.cxx Thu Oct 10 16:20:50 2013
@@ -346,11 +346,15 @@ sal_Bool ScTransferObj::GetData( const d
}
else if ( nFormat == SOT_FORMAT_GDIMETAFILE )
{
- InitDocShell();
+ // #123405# Do not limit visual size calculation for metafile creation.
+ // It seems unlikely that removing the limitation causes problems since
+ // metafile creation means that no real pixel device in the needed size is
+ // created.
+ InitDocShell(false);
+
SfxObjectShell* pEmbObj = aDocShellRef;
// like SvEmbeddedTransfer::GetData:
-
GDIMetaFile aMtf;
VirtualDevice aVDev;
MapMode aMapMode( pEmbObj->GetMapUnit() );
@@ -372,7 +376,8 @@ sal_Bool ScTransferObj::GetData( const d
else if ( nFormat == SOT_FORMATSTR_ID_EMBED_SOURCE )
{
//TODO/LATER: differentiate between formats?!
- InitDocShell(); // set aDocShellRef
+ // #123405# Do limit visual size calculation to PageSize
+ InitDocShell(true); // set aDocShellRef
SfxObjectShell* pEmbObj = aDocShellRef;
bOK = SetObject( pEmbObj, SCTRANS_TYPE_EMBOBJ, rFlavor );
@@ -574,8 +579,10 @@ ScMarkData ScTransferObj::GetSourceMarkD
//
// initialize aDocShellRef with a live document from the ClipDoc
//
+// #123405# added parameter to allow size calculation without limitation
+// to PageSize, e.g. used for Metafile creation for clipboard.
-void ScTransferObj::InitDocShell()
+void ScTransferObj::InitDocShell(bool bLimitToPageSize)
{
if ( !aDocShellRef.Is() )
{
@@ -697,14 +704,14 @@ void ScTransferObj::InitDocShell()
for (nCol=nStartX; nCol<=nEndX; nCol++)
{
long nAdd = pDestDoc->GetColWidth( nCol, 0 );
- if ( nSizeX+nAdd > aPaperSize.Width() && nSizeX ) // above limit?
+ if ( bLimitToPageSize && nSizeX+nAdd > aPaperSize.Width() && nSizeX ) // above limit?
break;
nSizeX += nAdd;
}
for (SCROW nRow=nStartY; nRow<=nEndY; nRow++)
{
long nAdd = pDestDoc->GetRowHeight( nRow, 0 );
- if ( nSizeY+nAdd > aPaperSize.Height() && nSizeY ) // above limit?
+ if ( bLimitToPageSize && nSizeY+nAdd > aPaperSize.Height() && nSizeY ) // above limit?
break;
nSizeY += nAdd;
}
Modified: openoffice/trunk/main/sc/source/ui/inc/transobj.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sc/source/ui/inc/transobj.hxx?rev=1531041&r1=1531040&r2=1531041&view=diff
==============================================================================
--- openoffice/trunk/main/sc/source/ui/inc/transobj.hxx (original)
+++ openoffice/trunk/main/sc/source/ui/inc/transobj.hxx Thu Oct 10 16:20:50 2013
@@ -62,7 +62,9 @@ private:
bool bHasFiltered; // if has filtered rows
bool bUseInApi; // to recognize clipboard content copied from API
- void InitDocShell();
+ // #123405# added parameter to allow size calculation without limitation
+ // to PageSize, e.g. used for Metafile creation for clipboard.
+ void InitDocShell(bool bLimitToPageSize);
static void StripRefs( ScDocument* pDoc, SCCOL nStartX, SCROW nStartY,
SCCOL nEndX, SCROW nEndY,
ScDocument* pDestDoc=0,