viewcontactofgraphic.cxx (4bf7a51a) viewcontactofgraphic.cxx (c0d661f1)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 79 unchanged lines hidden (view full) ---

88 // is best achieved for the VC by clearing the local decomposition cache. It would be possible
89 // to also do this for the VOC cache, but that VOCs exist exactly expresss that the object
90 // gets visualised, so this would be wrong.
91 flushViewIndependentPrimitive2DSequence();
92 }
93
94 drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGraphic::createVIP2DSForPresObj(
95 const basegfx::B2DHomMatrix& rObjectMatrix,
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 79 unchanged lines hidden (view full) ---

88 // is best achieved for the VC by clearing the local decomposition cache. It would be possible
89 // to also do this for the VOC cache, but that VOCs exist exactly expresss that the object
90 // gets visualised, so this would be wrong.
91 flushViewIndependentPrimitive2DSequence();
92 }
93
94 drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGraphic::createVIP2DSForPresObj(
95 const basegfx::B2DHomMatrix& rObjectMatrix,
96 const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute,
97 const GraphicAttr& rLocalGrafInfo) const
96 const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute) const
98 {
99 drawinglayer::primitive2d::Primitive2DSequence xRetval;
100 GraphicObject aEmptyGraphicObject;
101 GraphicAttr aEmptyGraphicAttr;
102
103 // SdrGrafPrimitive2D without content in original size which carries all eventual attributes and texts
104 const drawinglayer::primitive2d::Primitive2DReference xReferenceA(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
105 rObjectMatrix,

--- 32 unchanged lines hidden (view full) ---

138 {
139 // create the EmptyPresObj fallback visualisation. The fallback graphic
140 // is already provided in rGraphicObject in this case, use it
141 aSmallerMatrix = basegfx::tools::createScaleTranslateB2DHomMatrix(aPrefSize.getWidth(), aPrefSize.getHeight(), fOffsetX, fOffsetY);
142 aSmallerMatrix = basegfx::tools::createShearXRotateTranslateB2DHomMatrix(fShearX, fRotate, aTranslate)
143 * aSmallerMatrix;
144
145 const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
97 {
98 drawinglayer::primitive2d::Primitive2DSequence xRetval;
99 GraphicObject aEmptyGraphicObject;
100 GraphicAttr aEmptyGraphicAttr;
101
102 // SdrGrafPrimitive2D without content in original size which carries all eventual attributes and texts
103 const drawinglayer::primitive2d::Primitive2DReference xReferenceA(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
104 rObjectMatrix,

--- 32 unchanged lines hidden (view full) ---

137 {
138 // create the EmptyPresObj fallback visualisation. The fallback graphic
139 // is already provided in rGraphicObject in this case, use it
140 aSmallerMatrix = basegfx::tools::createScaleTranslateB2DHomMatrix(aPrefSize.getWidth(), aPrefSize.getHeight(), fOffsetX, fOffsetY);
141 aSmallerMatrix = basegfx::tools::createShearXRotateTranslateB2DHomMatrix(fShearX, fRotate, aTranslate)
142 * aSmallerMatrix;
143
144 const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
145 const GraphicAttr aLocalGrafInfo;
146 const drawinglayer::primitive2d::Primitive2DReference xReferenceB(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
146 const drawinglayer::primitive2d::Primitive2DReference xReferenceB(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
147 aSmallerMatrix,
148 drawinglayer::attribute::SdrLineFillShadowTextAttribute(),
149 rGraphicObject,
150 rLocalGrafInfo));
147 aSmallerMatrix,
148 drawinglayer::attribute::SdrLineFillShadowTextAttribute(),
149 rGraphicObject,
150 aLocalGrafInfo));
151
152 drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xReferenceB);
153 }
154
155 return xRetval;
156 }
157
158 drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGraphic::createVIP2DSForDraft(

--- 215 unchanged lines hidden (view full) ---

374
375 // get the current, unchenged graphic obect from SdrGrafObj
376 const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
377
378 if(visualisationUsesPresObj())
379 {
380 // it's an EmptyPresObj, create the SdrGrafPrimitive2D without content and another scaled one
381 // with the content which is the placeholder graphic
151
152 drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xReferenceB);
153 }
154
155 return xRetval;
156 }
157
158 drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGraphic::createVIP2DSForDraft(

--- 215 unchanged lines hidden (view full) ---

374
375 // get the current, unchenged graphic obect from SdrGrafObj
376 const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
377
378 if(visualisationUsesPresObj())
379 {
380 // it's an EmptyPresObj, create the SdrGrafPrimitive2D without content and another scaled one
381 // with the content which is the placeholder graphic
382 xRetval = createVIP2DSForPresObj(aObjectMatrix, aAttribute, aLocalGrafInfo);
382 xRetval = createVIP2DSForPresObj(aObjectMatrix, aAttribute);
383 }
384 else if(visualisationUsesDraft())
385 {
386 // #i102380# The graphic is swapped out. To not force a swap-in here, there is a mechanism
387 // which shows a swapped-out-visualisation (which gets created here now) and an asynchronious
388 // visual update mechanism for swapped-out grapgics when they were loaded (see AsynchGraphicLoadingEvent
389 // and ViewObjectContactOfGraphic implementation). Not forcing the swap-in here allows faster
390 // (non-blocking) processing here and thus in the effect e.g. fast scrolling through pages
391 xRetval = createVIP2DSForDraft(aObjectMatrix, aAttribute);
392 }
393 else
394 {
383 }
384 else if(visualisationUsesDraft())
385 {
386 // #i102380# The graphic is swapped out. To not force a swap-in here, there is a mechanism
387 // which shows a swapped-out-visualisation (which gets created here now) and an asynchronious
388 // visual update mechanism for swapped-out grapgics when they were loaded (see AsynchGraphicLoadingEvent
389 // and ViewObjectContactOfGraphic implementation). Not forcing the swap-in here allows faster
390 // (non-blocking) processing here and thus in the effect e.g. fast scrolling through pages
391 xRetval = createVIP2DSForDraft(aObjectMatrix, aAttribute);
392 }
393 else
394 {
395 // create primitive. Info: Calling the copy-constructor of GraphicObject in this
396 // SdrGrafPrimitive2D constructor will force a full swap-in of the graphic
397 const drawinglayer::primitive2d::Primitive2DReference xReference(
395 // create primitive. Info: Calling the copy-constructor of GraphicObject in this
396 // SdrGrafPrimitive2D constructor will force a full swap-in of the graphic
397 const drawinglayer::primitive2d::Primitive2DReference xReference(
398 new drawinglayer::primitive2d::SdrGrafPrimitive2D(
399 aObjectMatrix,
400 aAttribute,
401 rGraphicObject,
402 aLocalGrafInfo));
403
398 new drawinglayer::primitive2d::SdrGrafPrimitive2D(
399 aObjectMatrix,
400 aAttribute,
401 rGraphicObject,
402 aLocalGrafInfo));
403
404 xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
404 xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
405 }
406
407 // always append an invisible outline for the cases where no visible content exists
408 drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
409 drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
410 false, aObjectMatrix));
411
412 return xRetval;

--- 32 unchanged lines hidden ---
405 }
406
407 // always append an invisible outline for the cases where no visible content exists
408 drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
409 drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
410 false, aObjectMatrix));
411
412 return xRetval;

--- 32 unchanged lines hidden ---