diff options
-rw-r--r-- | sw/inc/ndarr.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/graphic/ndgrf.cxx | 18 | ||||
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 6 |
3 files changed, 15 insertions, 12 deletions
diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx index 80270f209f08..1c2bdf87a2bf 100644 --- a/sw/inc/ndarr.hxx +++ b/sw/inc/ndarr.hxx @@ -219,8 +219,7 @@ public: const OUString& rFltName, const Graphic* pGraphic, SwGrfFormatColl *pColl, - SwAttrSet const * pAutoAttr = nullptr, - bool bDelayed = false ); ///< in ndgrf.cxx + SwAttrSet const * pAutoAttr = nullptr ); ///< in ndgrf.cxx static SwGrfNode *MakeGrfNode( const SwNodeIndex & rWhere, const GraphicObject& rGrfObj, diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index e6dd87bd0616..7ef061715ba8 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -60,7 +60,8 @@ using namespace com::sun::star; SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere, - const OUString& rGrfName, const OUString& rFltName, + const OUString& rGrfName, + const OUString& rFltName, const Graphic* pGraphic, SwGrfFormatColl *pGrfColl, SwAttrSet const * pAutoAttr ) : @@ -80,8 +81,9 @@ SwGrfNode::SwGrfNode( } SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere, - const GraphicObject& rGrfObj, - SwGrfFormatColl *pGrfColl, SwAttrSet const * pAutoAttr ) : + const GraphicObject& rGrfObj, + SwGrfFormatColl *pGrfColl, + SwAttrSet const * pAutoAttr ) : SwNoTextNode( rWhere, SwNodeType::Grf, pGrfColl, pAutoAttr ), maGrfObj(rGrfObj), mpReplacementGraphic(nullptr), @@ -102,7 +104,8 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere, * @note Does not read/open the image itself! */ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere, - const OUString& rGrfName, const OUString& rFltName, + const OUString& rGrfName, + const OUString& rFltName, SwGrfFormatColl *pGrfColl, SwAttrSet const * pAutoAttr ) : SwNoTextNode( rWhere, SwNodeType::Grf, pGrfColl, pAutoAttr ), @@ -119,7 +122,7 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere, bInSwapIn = bChgTwipSize = bFrameInPaint = bScaleImageMap = false; - bGraphicArrived = true; + bGraphicArrived = false; InsertLink( rGrfName, rFltName ); if( IsLinkedFile() ) @@ -425,13 +428,12 @@ SwGrfNode * SwNodes::MakeGrfNode( const SwNodeIndex & rWhere, const OUString& rFltName, const Graphic* pGraphic, SwGrfFormatColl* pGrfColl, - SwAttrSet const * pAutoAttr, - bool bDelayed ) + SwAttrSet const * pAutoAttr ) { OSL_ENSURE( pGrfColl, "MakeGrfNode: Formatpointer is 0." ); SwGrfNode *pNode; // create object delayed, only from a SW/G-reader - if( bDelayed ) + if( !pGraphic ) pNode = new SwGrfNode( rWhere, rGrfName, rFltName, pGrfColl, pAutoAttr ); else diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index a73201a56b1c..c715ee00f76a 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2836,7 +2836,8 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan } Graphic aGraphic; const ::uno::Any* pGraphic; - if( pProps->GetProperty( FN_UNO_GRAPHIC, 0, pGraphic )) + const bool bHasGraphic = pProps->GetProperty( FN_UNO_GRAPHIC, 0, pGraphic ); + if( bHasGraphic ) { uno::Reference< graphic::XGraphic > xGraphic; (*pGraphic) >>= xGraphic; @@ -2854,7 +2855,8 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan ? pDoc->getIDocumentContentOperations().InsertGraphicObject( aPam, *pGrfObj, &aFrameSet, &aGrSet, pParentFrameFormat) : pDoc->getIDocumentContentOperations().InsertGraphic( - aPam, sGraphicURL, sFltName, &aGraphic, + aPam, sGraphicURL, sFltName, + (!bHasGraphic && !sGraphicURL.isEmpty()) ? nullptr : &aGraphic, &aFrameSet, &aGrSet, pParentFrameFormat); delete pGrfObj; if(pFormat) |