oovbaapi/ooo/vba/word/XRange.idl |    3 +++
 sw/source/ui/vba/vbarange.cxx    |    9 +++++++++
 sw/source/ui/vba/vbarange.hxx    |    3 +++
 3 files changed, 15 insertions(+)

New commits:
commit 0b5df6634a2021986b0de2ab12a41c0d4af4f60c
Author:     Hannah Meeks <[email protected]>
AuthorDate: Tue Jul 12 15:47:03 2022 +0100
Commit:     Tomaž Vajngerl <[email protected]>
CommitDate: Thu Jul 14 10:19:31 2022 +0200

    tdf#149963 -  XFind not a property/attribute of XRange
    
    Updated XRange to include XFind
    
    Change-Id: If9570fbb5de8d14063a72a4c4c55fcfd491dd496
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137004
    Tested-by: Tomaž Vajngerl <[email protected]>
    Reviewed-by: Tomaž Vajngerl <[email protected]>

diff --git a/oovbaapi/ooo/vba/word/XRange.idl b/oovbaapi/ooo/vba/word/XRange.idl
index fa0bf5e6d718..ea5e05d2a497 100644
--- a/oovbaapi/ooo/vba/word/XRange.idl
+++ b/oovbaapi/ooo/vba/word/XRange.idl
@@ -23,6 +23,7 @@ module ooo {  module vba {  module word {
 interface XParagraphFormat;
 interface XStyle;
 interface XFont;
+interface XFind;
 interface XListFormat;
 interface XRange
 {
@@ -35,6 +36,8 @@ interface XRange
     // Of course Font is NOT readonly, #FIXME #TODO
     // readonly though will force an error attempting to write
     [attribute, readonly] XFont Font;
+    [attribute, readonly] XFind Find;
+
     [attribute] long LanguageID;
     [attribute] long Start;
     [attribute] long End;
diff --git a/sw/source/ui/vba/vbarange.cxx b/sw/source/ui/vba/vbarange.cxx
index eaa7cac51c3b..8803b067316b 100644
--- a/sw/source/ui/vba/vbarange.cxx
+++ b/sw/source/ui/vba/vbarange.cxx
@@ -29,6 +29,7 @@
 #include "vbaparagraphformat.hxx"
 #include "vbastyle.hxx"
 #include "vbafont.hxx"
+#include "vbafind.hxx"
 #include "vbapalette.hxx"
 #include "vbapagesetup.hxx"
 #include "vbalistformat.hxx"
@@ -297,6 +298,14 @@ SwVbaRange::getFont()
     return new SwVbaFont( mxParent, mxContext, aColors.getPalette(), 
uno::Reference< beans::XPropertySet >( getXTextRange(), uno::UNO_QUERY_THROW ) 
);
 }
 
+uno::Reference< word::XFind > SAL_CALL
+SwVbaRange::getFind()
+{
+    uno::Reference< text::XTextRange > xTextRange = getXTextRange();
+    uno::Reference< frame::XModel > xModel( mxTextDocument, 
uno::UNO_QUERY_THROW );
+    return SwVbaFind::GetOrCreateFind(this, mxContext, xModel, xTextRange);
+}
+
 uno::Reference< word::XListFormat > SAL_CALL
 SwVbaRange::getListFormat()
 {
diff --git a/sw/source/ui/vba/vbarange.hxx b/sw/source/ui/vba/vbarange.hxx
index d311c25a70c9..38e2631e40fe 100644
--- a/sw/source/ui/vba/vbarange.hxx
+++ b/sw/source/ui/vba/vbarange.hxx
@@ -22,6 +22,7 @@
 #include <ooo/vba/word/XRange.hpp>
 #include <ooo/vba/word/XParagraphFormat.hpp>
 #include <ooo/vba/word/XFont.hpp>
+#include <ooo/vba/word/XFind.hpp>
 #include <vbahelper/vbahelperinterface.hxx>
 #include <com/sun/star/text/XTextRange.hpp>
 #include <com/sun/star/text/XTextDocument.hpp>
@@ -68,7 +69,9 @@ public:
     virtual void SAL_CALL setStyle( const css::uno::Any& _xStyle ) override;
 
     virtual css::uno::Reference< ooo::vba::word::XFont > SAL_CALL getFont() 
override;
+    virtual css::uno::Reference< ooo::vba::word::XFind > SAL_CALL getFind() 
override;
     virtual css::uno::Reference< ooo::vba::word::XListFormat > SAL_CALL 
getListFormat() override;
+
     // Methods
     virtual void SAL_CALL InsertBreak(const css::uno::Any& _breakType) 
override;
     virtual void SAL_CALL Select() override;

Reply via email to