summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorRadek Doulik <rodo@novell.com>2012-01-31 10:07:46 +0100
committerRadek Doulik <rodo@novell.com>2012-01-31 11:35:46 +0100
commitbfc9d72d70092a6d59c1df65308f04e8bc80f80b (patch)
tree60dcadcfa31d75ca550bb05378a23ae49e0aa0be /vcl
parent965f3ae45ad605baf4d25d3cc8aaa9be85886b97 (diff)
fix rendering of metafiles embedded in emf+ (updated)
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/gdimtf.cxx43
1 files changed, 25 insertions, 18 deletions
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index e9ac49e0da5e..93be21a86829 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -406,29 +406,32 @@ void GDIMetaFile::Play( OutputDevice* pOut, size_t nPos )
pOut->SetLayoutMode( 0 );
pOut->SetDigitLanguage( 0 );
- for( size_t nCurPos = nCurrentActionElement; nCurPos < nPos; nCurPos++ )
- {
- if( !Hook() )
+ OSL_TRACE("GDIMetaFile::Play on device of size: %d x %d", pOut->GetOutputSizePixel().Width(), pOut->GetOutputSizePixel().Height());
+
+ if( !ImplPlayWithRenderer( pOut, Point(0,0), pOut->GetOutputSizePixel() ) ) {
+ for( size_t nCurPos = nCurrentActionElement; nCurPos < nPos; nCurPos++ )
{
- MetaCommentAction* pCommentAct = static_cast<MetaCommentAction*>(pAction);
- if( pAction->GetType() == META_COMMENT_ACTION &&
- pCommentAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("DELEGATE_PLUGGABLE_RENDERER")) )
+ if( !Hook() )
{
- ImplDelegate2PluggableRenderer(pCommentAct, pOut);
- }
- else
- {
- pAction->Execute( pOut );
+ MetaCommentAction* pCommentAct = static_cast<MetaCommentAction*>(pAction);
+ if( pAction->GetType() == META_COMMENT_ACTION &&
+ pCommentAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("DELEGATE_PLUGGABLE_RENDERER")) )
+ {
+ ImplDelegate2PluggableRenderer(pCommentAct, pOut);
+ }
+ else
+ {
+ pAction->Execute( pOut );
+ }
+
+ // flush output from time to time
+ if( i++ > nSyncCount )
+ ( (Window*) pOut )->Flush(), i = 0;
}
- // flush output from time to time
- if( i++ > nSyncCount )
- ( (Window*) pOut )->Flush(), i = 0;
+ pAction = NextAction();
}
-
- pAction = NextAction();
}
-
pOut->Pop();
}
}
@@ -437,6 +440,9 @@ void GDIMetaFile::Play( OutputDevice* pOut, size_t nPos )
bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rDestSize )
{
+ if (!bUseCanvas)
+ return false;
+
const Window* win = dynamic_cast <Window*> ( pOut );
if (!win)
@@ -608,7 +614,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
{
GDIMetaFile* pMtf = pOut->GetConnectMetaFile();
- if( bUseCanvas && !pMtf && ImplPlayWithRenderer( pOut, rPos, aDestSize ) )
+ if( ImplPlayWithRenderer( pOut, rPos, aDestSize ) )
return;
Size aTmpPrefSize( pOut->LogicToPixel( GetPrefSize(), aDrawMap ) );
@@ -2042,6 +2048,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
aMtf.aPrefSize = aPrefSize;
aMtf.aPrefMapMode = aPrefMapMode;
+ aMtf.bUseCanvas = bUseCanvas;
for( MetaAction* pAction = FirstAction(); pAction; pAction = NextAction() )
{