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 <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
diff --git a/oovbaapi/ooo/vba/word/XRange.idl b/oovbaapi/ooo/vba/word/XRange.idl
index fa0bf5e..ea5e05d 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 eaa7cac..8803b06 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 d311c25..38e2631 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;