sw/inc/unoframe.hxx                                  |    9 +-
 sw/inc/unotxdoc.hxx                                  |    2 
 sw/source/uibase/uno/unotxdoc.cxx                    |    7 +
 sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx |    9 --
 sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx |    3 
 sw/source/writerfilter/dmapper/GraphicImport.cxx     |   83 +++++++++----------
 sw/source/writerfilter/dmapper/GraphicImport.hxx     |    9 +-
 7 files changed, 65 insertions(+), 57 deletions(-)

New commits:
commit 2ccf6f2a203a5a215f7a1e4d097cc08a73d22f2c
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Apr 24 15:12:03 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Apr 28 22:26:42 2024 +0200

    use more explicit UNO types in writerfilter
    
    Change-Id: Icf26a78679398746a6c51453ae2de64615de088e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166803
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx
index 33648faf7bde..4ddb08e92baf 100644
--- a/sw/inc/unoframe.hxx
+++ b/sw/inc/unoframe.hxx
@@ -99,7 +99,7 @@ protected:
 public:
 
     //XNamed
-    virtual OUString SAL_CALL getName() override;
+    SW_DLLPUBLIC virtual OUString SAL_CALL getName() override;
     SW_DLLPUBLIC virtual void SAL_CALL setName(const OUString& Name_) override;
 
     //XPropertySet
@@ -188,7 +188,7 @@ public:
     using SwXText::SetDoc;
 
     virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType 
) override;
-    virtual void SAL_CALL acquire(  ) noexcept override;
+    virtual SW_DLLPUBLIC void SAL_CALL acquire(  ) noexcept override;
     virtual SW_DLLPUBLIC void SAL_CALL release(  ) noexcept override;
 
     //XTypeProvider
diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx 
b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
index 879e9a38f8ce..ff6bcf342b35 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
@@ -5823,7 +5823,7 @@ void 
DomainMapper_Impl::AttachTextBoxContentToShape(css::uno::Reference<css::dra
         return;
 
     // if this is a textbox there must be a waiting frame
-    auto xTextBox = m_xPendingTextBoxFrames.front();
+    rtl::Reference<SwXTextFrame> xTextBox = m_xPendingTextBoxFrames.front();
     if (!xTextBox)
         return;
 
@@ -5833,7 +5833,7 @@ void 
DomainMapper_Impl::AttachTextBoxContentToShape(css::uno::Reference<css::dra
     // Attach the textbox to the shape
     try
     {
-        xProps->setPropertyValue("TextBoxContent", uno::Any(xTextBox));
+        xProps->setPropertyValue("TextBoxContent", uno::Any(uno::Reference< 
text::XTextFrame >(xTextBox)));
     }
     catch (...)
     {
@@ -5846,9 +5846,8 @@ void 
DomainMapper_Impl::AttachTextBoxContentToShape(css::uno::Reference<css::dra
     {
         // Get the name of the textbox
         OUString sTextBoxName;
-        uno::Reference<container::XNamed> xName(xTextBox, uno::UNO_QUERY);
-        if (xName && !xName->getName().isEmpty())
-            sTextBoxName = xName->getName();
+        if (!xTextBox->getName().isEmpty())
+            sTextBoxName = xTextBox->getName();
 
         // Try to get the grabbag
         uno::Sequence<beans::PropertyValue> aOldGrabBagSeq;
diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx 
b/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx
index 7cd24bf51821..8623c28e55d9 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx
@@ -59,6 +59,7 @@ class SwXTextDocument;
 class SwXDocumentSettings;
 class SwXTextSection;
 class SwXTextField;
+class SwXTextFrame;
 namespace com::sun::star{
         namespace awt{
             struct Size;
@@ -679,7 +680,7 @@ private:
     css::uno::Reference<css::text::XTextRange> m_xGlossaryEntryStart;
     std::stack<BookmarkInsertPosition> m_xSdtStarts;
 
-    std::queue< css::uno::Reference< css::text::XTextFrame > > 
m_xPendingTextBoxFrames;
+    std::queue< rtl::Reference< SwXTextFrame > > m_xPendingTextBoxFrames;
 
 public:
     css::uno::Reference<css::text::XTextRange> m_xInsertTextRange;
commit 7ee095d7e075ebc12183378c65fe64e5c0fc1ba4
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Apr 24 15:02:18 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Apr 28 22:26:33 2024 +0200

    use more concrete UNO classes in writerfilter (SwXTextGraphicObject)
    
    Change-Id: I27c96bd3c18d24398f773319fa41bed8a8da9eee
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166802
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx
index 705e52e40440..33648faf7bde 100644
--- a/sw/inc/unoframe.hxx
+++ b/sw/inc/unoframe.hxx
@@ -19,6 +19,7 @@
 #ifndef INCLUDED_SW_INC_UNOFRAME_HXX
 #define INCLUDED_SW_INC_UNOFRAME_HXX
 
+#include "swdllapi.h"
 #include <com/sun/star/beans/XPropertyState.hpp>
 #include <com/sun/star/container/XNamed.hpp>
 #include <com/sun/star/container/XEnumerationAccess.hpp>
@@ -103,7 +104,7 @@ public:
 
     //XPropertySet
     virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL 
getPropertySetInfo(  ) override;
-    virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, 
const css::uno::Any& aValue ) override;
+    SW_DLLPUBLIC virtual void SAL_CALL setPropertyValue( const OUString& 
aPropertyName, const css::uno::Any& aValue ) override;
     virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& 
PropertyName ) override;
     virtual void SAL_CALL addPropertyChangeListener( const OUString& 
aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener 
>& xListener ) override;
     virtual void SAL_CALL removePropertyChangeListener( const OUString& 
aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener 
>& aListener ) override;
@@ -236,7 +237,7 @@ typedef cppu::ImplInheritanceHelper
     css::document::XEventsSupplier
 >
 SwXTextGraphicObjectBaseClass;
-class SwXTextGraphicObject final : public SwXTextGraphicObjectBaseClass
+class SW_DLLPUBLIC SwXTextGraphicObject final : public 
SwXTextGraphicObjectBaseClass
 {
     friend class SwXFrame; // just for CreateXFrame
 
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index 59fab6827acb..d84561244258 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -112,6 +112,7 @@ class SwXTextSection;
 class SwXTextField;
 class SwXLineBreak;
 class SwXTextFrame;
+class SwXTextGraphicObject;
 namespace com::sun::star::container { class XNameContainer; }
 namespace com::sun::star::frame { class XController; }
 namespace com::sun::star::lang { struct Locale; }
@@ -522,6 +523,7 @@ public:
     SW_DLLPUBLIC rtl::Reference<SwXTextField> createFieldAnnotation();
     SW_DLLPUBLIC rtl::Reference<SwXLineBreak> createLineBreak();
     SW_DLLPUBLIC rtl::Reference<SwXTextFrame> createTextFrame();
+    SW_DLLPUBLIC rtl::Reference<SwXTextGraphicObject> 
createTextGraphicObject();
 };
 
 class SwXLinkTargetSupplier final : public cppu::WeakImplHelper
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 3d36312afecc..2fa09ab06e70 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -1713,6 +1713,13 @@ rtl::Reference< SwXTextFrame > 
SwXTextDocument::createTextFrame()
     return SwXTextFrame::CreateXTextFrame(GetDocOrThrow(), nullptr);
 }
 
+rtl::Reference< SwXTextGraphicObject > 
SwXTextDocument::createTextGraphicObject()
+{
+    SolarMutexGuard aGuard;
+    ThrowIfInvalid();
+    return SwXTextGraphicObject::CreateXTextGraphicObject(GetDocOrThrow(), 
nullptr);
+}
+
 Reference< XInterface >  SwXTextDocument::createInstance(const OUString& 
rServiceName)
 {
     return create(rServiceName, nullptr);
diff --git a/sw/source/writerfilter/dmapper/GraphicImport.cxx 
b/sw/source/writerfilter/dmapper/GraphicImport.cxx
index 2df2569530a1..0320c671c47f 100644
--- a/sw/source/writerfilter/dmapper/GraphicImport.cxx
+++ b/sw/source/writerfilter/dmapper/GraphicImport.cxx
@@ -82,6 +82,8 @@
 #include <o3tl/unit_conversion.hxx>
 #include <oox/export/drawingml.hxx>
 #include <utility>
+#include <unoframe.hxx>
+#include <unotxdoc.hxx>
 
 using namespace css;
 
@@ -467,7 +469,7 @@ public:
 };
 
 GraphicImport::GraphicImport(uno::Reference<uno::XComponentContext> 
xComponentContext,
-                             uno::Reference<lang::XMultiServiceFactory> 
xTextFactory,
+                             rtl::Reference<SwXTextDocument> xTextDoc,
                              DomainMapper& rDMapper,
                              GraphicImportType & rImportType,
                              std::pair<OUString, OUString>& rPositionOffsets,
@@ -478,7 +480,7 @@ 
GraphicImport::GraphicImport(uno::Reference<uno::XComponentContext> xComponentCo
 , LoggedStream("GraphicImport")
 , m_pImpl(new GraphicImport_Impl(rImportType, rDMapper, rPositionOffsets, 
rAligns, rPositivePercentages))
 , m_xComponentContext(std::move(xComponentContext))
-, m_xTextFactory(std::move(xTextFactory))
+, m_xTextDoc(std::move(xTextDoc))
 {
 }
 
@@ -873,12 +875,10 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
                         if ( !bUseShape )
                         {
                             // Define the object size
-                            uno::Reference< beans::XPropertySet > xGraphProps( 
m_xGraphicObject,
-                                    uno::UNO_QUERY );
                             awt::Size aSize = xShape->getSize( );
-                            xGraphProps->setPropertyValue("Height",
+                            m_xGraphicObject->setPropertyValue("Height",
                                    uno::Any( aSize.Height ) );
-                            xGraphProps->setPropertyValue("Width",
+                            m_xGraphicObject->setPropertyValue("Width",
                                    uno::Any( aSize.Width ) );
 
                             text::GraphicCrop aGraphicCrop( 0, 0, 0, 0 );
@@ -886,12 +886,12 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
                             uno::Any aAny = 
xSourceGraphProps->getPropertyValue("GraphicCrop");
                             if (m_pImpl->m_oCrop)
                             {   // RTF: RTFValue from resolvePict()
-                                xGraphProps->setPropertyValue("GraphicCrop",
+                                
m_xGraphicObject->setPropertyValue("GraphicCrop",
                                         uno::Any(*m_pImpl->m_oCrop));
                             }
                             else if (aAny >>= aGraphicCrop)
                             {   // DOCX: imported in oox BlipFillContext
-                                xGraphProps->setPropertyValue("GraphicCrop",
+                                
m_xGraphicObject->setPropertyValue("GraphicCrop",
                                     uno::Any( aGraphicCrop ) );
                             }
 
@@ -1771,23 +1771,20 @@ void GraphicImport::lcl_entry(const 
writerfilter::Reference<Properties>::Pointer
 {
 }
 
-uno::Reference<text::XTextContent> 
GraphicImport::createGraphicObject(uno::Reference<graphic::XGraphic> const & 
rxGraphic,
+rtl::Reference<SwXTextGraphicObject> 
GraphicImport::createGraphicObject(uno::Reference<graphic::XGraphic> const & 
rxGraphic,
                                                                       
uno::Reference<beans::XPropertySet> const & xShapeProps)
 {
-    uno::Reference<text::XTextContent> xGraphicObject;
+    rtl::Reference<SwXTextGraphicObject> xGraphicObject;
     try
     {
         if (rxGraphic.is())
         {
-            uno::Reference< beans::XPropertySet > xGraphicObjectProperties(
-                
m_xTextFactory->createInstance("com.sun.star.text.TextGraphicObject"),
-                uno::UNO_QUERY_THROW);
-            
xGraphicObjectProperties->setPropertyValue(getPropertyName(PROP_GRAPHIC), 
uno::Any(rxGraphic));
-            
xGraphicObjectProperties->setPropertyValue(getPropertyName(PROP_ANCHOR_TYPE),
+            xGraphicObject = m_xTextDoc->createTextGraphicObject();
+            xGraphicObject->setPropertyValue(getPropertyName(PROP_GRAPHIC), 
uno::Any(rxGraphic));
+            xGraphicObject->setPropertyValue(getPropertyName(PROP_ANCHOR_TYPE),
                 uno::Any( m_pImpl->m_rGraphicImportType == 
IMPORT_AS_DETECTED_ANCHOR ?
                                     text::TextContentAnchorType_AT_CHARACTER :
                                     text::TextContentAnchorType_AS_CHARACTER 
));
-            xGraphicObject.set( xGraphicObjectProperties, uno::UNO_QUERY_THROW 
);
 
             //shapes have only one border
             table::BorderLine2 aBorderLine;
@@ -1816,7 +1813,7 @@ uno::Reference<text::XTextContent> 
GraphicImport::createGraphicObject(uno::Refer
             };
 
             for(PropertyIds const & rBorderProp : aBorderProps)
-                
xGraphicObjectProperties->setPropertyValue(getPropertyName(rBorderProp), 
uno::Any(aBorderLine));
+                xGraphicObject->setPropertyValue(getPropertyName(rBorderProp), 
uno::Any(aBorderLine));
 
             // setting graphic object shadow properties
             if (m_pImpl->m_bShadow)
@@ -1847,18 +1844,18 @@ uno::Reference<text::XTextContent> 
GraphicImport::createGraphicObject(uno::Refer
                         aShadow.Location = table::ShadowLocation_TOP_LEFT;
                 }
 
-                
xGraphicObjectProperties->setPropertyValue(getPropertyName(PROP_SHADOW_FORMAT), 
uno::Any(aShadow));
+                
xGraphicObject->setPropertyValue(getPropertyName(PROP_SHADOW_FORMAT), 
uno::Any(aShadow));
             }
 
             // setting properties for all types
             if( m_pImpl->m_bPositionProtected )
-                xGraphicObjectProperties->setPropertyValue(getPropertyName( 
PROP_POSITION_PROTECTED ),
+                xGraphicObject->setPropertyValue(getPropertyName( 
PROP_POSITION_PROTECTED ),
                     uno::Any(true));
             if( m_pImpl->m_bSizeProtected )
-                xGraphicObjectProperties->setPropertyValue(getPropertyName( 
PROP_SIZE_PROTECTED ),
+                xGraphicObject->setPropertyValue(getPropertyName( 
PROP_SIZE_PROTECTED ),
                     uno::Any(true));
 
-            
xGraphicObjectProperties->setPropertyValue(getPropertyName(PROP_DECORATIVE), 
uno::Any(m_pImpl->m_bDecorative));
+            xGraphicObject->setPropertyValue(getPropertyName(PROP_DECORATIVE), 
uno::Any(m_pImpl->m_bDecorative));
             sal_Int32 nWidth = - m_pImpl->m_nLeftPosition;
             if (m_pImpl->m_rGraphicImportType == IMPORT_AS_DETECTED_ANCHOR)
             {
@@ -1923,41 +1920,41 @@ uno::Reference<text::XTextContent> 
GraphicImport::createGraphicObject(uno::Refer
                     m_pImpl->m_nTopPosition *= -1;
                 }
 
-                m_pImpl->applyPosition(xGraphicObjectProperties);
-                m_pImpl->applyRelativePosition(xGraphicObjectProperties);
+                m_pImpl->applyPosition(xGraphicObject);
+                m_pImpl->applyRelativePosition(xGraphicObject);
                 if( !m_pImpl->m_bOpaque )
                 {
-                    
xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_OPAQUE ), 
uno::Any(m_pImpl->m_bOpaque));
+                    xGraphicObject->setPropertyValue(getPropertyName( 
PROP_OPAQUE ), uno::Any(m_pImpl->m_bOpaque));
                 }
-                xGraphicObjectProperties->setPropertyValue(getPropertyName( 
PROP_SURROUND ),
+                xGraphicObject->setPropertyValue(getPropertyName( 
PROP_SURROUND ),
                     uno::Any(static_cast<sal_Int32>(m_pImpl->m_nWrap)));
                 if( m_pImpl->m_rDomainMapper.IsInTable())
-                    
xGraphicObjectProperties->setPropertyValue(getPropertyName( 
PROP_FOLLOW_TEXT_FLOW ),
+                    xGraphicObject->setPropertyValue(getPropertyName( 
PROP_FOLLOW_TEXT_FLOW ),
                         uno::Any(m_pImpl->m_bLayoutInCell));
 
-                
xGraphicObjectProperties->setPropertyValue(getPropertyName(PROP_ALLOW_OVERLAP),
+                
xGraphicObject->setPropertyValue(getPropertyName(PROP_ALLOW_OVERLAP),
                                                            
uno::Any(m_pImpl->m_bAllowOverlap));
 
-                xGraphicObjectProperties->setPropertyValue(getPropertyName( 
PROP_SURROUND_CONTOUR ),
+                xGraphicObject->setPropertyValue(getPropertyName( 
PROP_SURROUND_CONTOUR ),
                     uno::Any(m_pImpl->m_bContour));
-                xGraphicObjectProperties->setPropertyValue(getPropertyName( 
PROP_CONTOUR_OUTSIDE ),
+                xGraphicObject->setPropertyValue(getPropertyName( 
PROP_CONTOUR_OUTSIDE ),
                     uno::Any(m_pImpl->m_bContourOutside));
-                m_pImpl->applyMargins(xGraphicObjectProperties);
+                m_pImpl->applyMargins(xGraphicObject);
             }
 
-            xGraphicObjectProperties->setPropertyValue(getPropertyName( 
PROP_ADJUST_CONTRAST ),
+            xGraphicObject->setPropertyValue(getPropertyName( 
PROP_ADJUST_CONTRAST ),
                 uno::Any(static_cast<sal_Int16>(m_pImpl->m_nContrast)));
-            xGraphicObjectProperties->setPropertyValue(getPropertyName( 
PROP_ADJUST_LUMINANCE ),
+            xGraphicObject->setPropertyValue(getPropertyName( 
PROP_ADJUST_LUMINANCE ),
                 uno::Any(static_cast<sal_Int16>(m_pImpl->m_nBrightness)));
             if(m_pImpl->m_eColorMode != drawing::ColorMode_STANDARD)
             {
-                xGraphicObjectProperties->setPropertyValue(getPropertyName( 
PROP_GRAPHIC_COLOR_MODE ),
+                xGraphicObject->setPropertyValue(getPropertyName( 
PROP_GRAPHIC_COLOR_MODE ),
                     uno::Any(m_pImpl->m_eColorMode));
             }
 
-            xGraphicObjectProperties->setPropertyValue(getPropertyName( 
PROP_BACK_COLOR ),
+            xGraphicObject->setPropertyValue(getPropertyName( PROP_BACK_COLOR 
),
                 uno::Any( GraphicImport_Impl::nFillColor ));
-            m_pImpl->applyZOrder(xGraphicObjectProperties);
+            m_pImpl->applyZOrder(xGraphicObject);
 
             //there seems to be no way to detect the original size via _real_ 
API
             uno::Reference< beans::XPropertySet > 
xGraphicProperties(rxGraphic, uno::UNO_QUERY_THROW);
@@ -1994,12 +1991,12 @@ uno::Reference<text::XTextContent> 
GraphicImport::createGraphicObject(uno::Refer
                 if (pCorrected)
                 {
                     aContourPolyPolygon <<= 
pCorrected->getPointSequenceSequence();
-                    
xGraphicObjectProperties->setPropertyValue(getPropertyName(PROP_CONTOUR_POLY_POLYGON),
+                    
xGraphicObject->setPropertyValue(getPropertyName(PROP_CONTOUR_POLY_POLYGON),
                         aContourPolyPolygon);
                     // We should bring it to front, even if wp:anchor's 
behindDoc="1",
                     // because otherwise paragraph background (if set) 
overlaps the graphic
                     // TODO: if paragraph's background becomes bottommost, 
then remove this hack
-                    xGraphicObjectProperties->setPropertyValue("Opaque", 
uno::Any(true));
+                    xGraphicObject->setPropertyValue("Opaque", uno::Any(true));
                 }
             }
 
@@ -2008,11 +2005,11 @@ uno::Reference<text::XTextContent> 
GraphicImport::createGraphicObject(uno::Refer
                 || m_pImpl->m_rGraphicImportType == IMPORT_AS_DETECTED_ANCHOR)
             {
                 if( m_pImpl->getXSize() && m_pImpl->getYSize() )
-                    
xGraphicObjectProperties->setPropertyValue(getPropertyName(PROP_SIZE),
+                    
xGraphicObject->setPropertyValue(getPropertyName(PROP_SIZE),
                         uno::Any( awt::Size( m_pImpl->getXSize(), 
m_pImpl->getYSize() )));
-                m_pImpl->applyMargins(xGraphicObjectProperties);
-                m_pImpl->applyName(xGraphicObjectProperties);
-                m_pImpl->applyHyperlink(xGraphicObjectProperties, false);
+                m_pImpl->applyMargins(xGraphicObject);
+                m_pImpl->applyName(xGraphicObject);
+                m_pImpl->applyHyperlink(xGraphicObject, false);
             }
 
             // Handle horizontal flip.
@@ -2020,9 +2017,9 @@ uno::Reference<text::XTextContent> 
GraphicImport::createGraphicObject(uno::Refer
             xShapeProps->getPropertyValue("IsMirrored") >>= bMirrored;
             if (bMirrored)
             {
-                
xGraphicObjectProperties->setPropertyValue("HoriMirroredOnEvenPages",
+                xGraphicObject->setPropertyValue("HoriMirroredOnEvenPages",
                                                            uno::Any(true));
-                
xGraphicObjectProperties->setPropertyValue("HoriMirroredOnOddPages",
+                xGraphicObject->setPropertyValue("HoriMirroredOnOddPages",
                                                            uno::Any(true));
             }
         }
diff --git a/sw/source/writerfilter/dmapper/GraphicImport.hxx 
b/sw/source/writerfilter/dmapper/GraphicImport.hxx
index dae19ce85c03..2ae7b83dd08a 100644
--- a/sw/source/writerfilter/dmapper/GraphicImport.hxx
+++ b/sw/source/writerfilter/dmapper/GraphicImport.hxx
@@ -27,6 +27,7 @@
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/graphic/XGraphic.hpp>
 
+class SwXTextGraphicObject;
 namespace com::sun::star {
     namespace uno
     {
@@ -67,14 +68,14 @@ class GraphicImport : public LoggedProperties, public 
LoggedTable
     std::unique_ptr<GraphicImport_Impl> m_pImpl;
 
     css::uno::Reference<css::uno::XComponentContext>     m_xComponentContext;
-    css::uno::Reference<css::lang::XMultiServiceFactory> m_xTextFactory;
+    rtl::Reference<SwXTextDocument> m_xTextDoc;
 
-    css::uno::Reference<css::text::XTextContent> m_xGraphicObject;
+    rtl::Reference<SwXTextGraphicObject> m_xGraphicObject;
 
     css::uno::Reference<css::drawing::XShape> m_xShape;
     void ProcessShapeOptions(Value const & val);
 
-    css::uno::Reference<css::text::XTextContent>
+    rtl::Reference<SwXTextGraphicObject>
             createGraphicObject(css::uno::Reference<css::graphic::XGraphic> 
const & rxGraphic,
                                 css::uno::Reference<css::beans::XPropertySet> 
const & xShapeProps);
 
@@ -82,7 +83,7 @@ class GraphicImport : public LoggedProperties, public 
LoggedTable
 
 public:
     explicit GraphicImport( css::uno::Reference<css::uno::XComponentContext>  
xComponentContext,
-                            
css::uno::Reference<css::lang::XMultiServiceFactory> xTextFactory,
+                            rtl::Reference<SwXTextDocument> xTextDoc,
                             DomainMapper& rDomainMapper,
                             GraphicImportType & rGraphicImportType,
                             std::pair<OUString, OUString>& rPositionOffsets,

Reply via email to