diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/envelp/label1.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/envelp/labelexp.cxx | 20 | ||||
-rw-r--r-- | sw/source/ui/envelp/swuilabimp.hxx | 3 | ||||
-rw-r--r-- | sw/source/ui/inc/glossary.hxx | 3 | ||||
-rw-r--r-- | sw/source/ui/inc/unoatxt.hxx | 25 | ||||
-rw-r--r-- | sw/source/ui/misc/glossary.cxx | 13 | ||||
-rw-r--r-- | sw/source/ui/vba/vbatemplate.cxx | 6 |
7 files changed, 35 insertions, 37 deletions
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx index 11ca073c67aa..9ffa4154c3cf 100644 --- a/sw/source/ui/envelp/label1.cxx +++ b/sw/source/ui/envelp/label1.cxx @@ -641,7 +641,7 @@ SwVisitingCardPage::~SwVisitingCardPage() { for(sal_uInt16 i = 0; i < aAutoTextGroupLB.GetEntryCount(); i++) delete (String*)aAutoTextGroupLB.GetEntryData( i ); - _xAutoText = 0; + m_xAutoText = 0; ClearUserData(); delete pExampleFrame; diff --git a/sw/source/ui/envelp/labelexp.cxx b/sw/source/ui/envelp/labelexp.cxx index ed30c8d7e430..a90eaef95e70 100644 --- a/sw/source/ui/envelp/labelexp.cxx +++ b/sw/source/ui/envelp/labelexp.cxx @@ -17,9 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/text/AutoTextContainer.hpp> #include <com/sun/star/text/XTextFieldsSupplier.hpp> #include <com/sun/star/util/XRefreshable.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <comphelper/processfactory.hxx> #include "svtools/treelistentry.hxx" #include <swtypes.hxx> @@ -52,16 +53,15 @@ void SwVisitingCardPage::InitFrameControl() getProcessServiceFactory(); //now the AutoText ListBoxes have to be filled - uno::Reference< uno::XInterface > xAText = xMgr->createInstance( "com.sun.star.text.AutoTextContainer" ); - _xAutoText = uno::Reference< container::XNameAccess >(xAText, uno::UNO_QUERY); + m_xAutoText = text::AutoTextContainer::create( comphelper::getComponentContext(xMgr) ); - uno::Sequence<OUString> aNames = _xAutoText->getElementNames(); + uno::Sequence<OUString> aNames = m_xAutoText->getElementNames(); const OUString* pGroups = aNames.getConstArray(); OUString uTitleName( rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_TITLE)) ); for(sal_uInt16 i = 0; i < aNames.getLength(); i++) { - uno::Any aGroup = _xAutoText->getByName(pGroups[i]); + uno::Any aGroup = m_xAutoText->getByName(pGroups[i]); uno::Reference< text::XAutoTextGroup > xGroup; aGroup >>= xGroup; uno::Reference< container::XIndexAccess > xIdxAcc(xGroup, uno::UNO_QUERY); @@ -88,9 +88,9 @@ void SwVisitingCardPage::InitFrameControl() aAutoTextGroupLB.SelectEntryPos(0); String sCurGroupName( *(String*)aAutoTextGroupLB.GetEntryData(aAutoTextGroupLB.GetSelectEntryPos())); - if(_xAutoText->hasByName(sCurGroupName)) + if(m_xAutoText->hasByName(sCurGroupName)) { - uno::Any aGroup = _xAutoText->getByName(sCurGroupName); + uno::Any aGroup = m_xAutoText->getByName(sCurGroupName); try { uno::Reference< text::XAutoTextGroup > xGroup; @@ -122,7 +122,7 @@ IMPL_LINK_NOARG(SwVisitingCardPage, FrameControlInitializedHdl) { String sGroup( *(String*)aAutoTextGroupLB.GetEntryData( aAutoTextGroupLB.GetSelectEntryPos() ) ); - uno::Any aGroup = _xAutoText->getByName(sGroup); + uno::Any aGroup = m_xAutoText->getByName(sGroup); uno::Reference< text::XAutoTextGroup > xGroup; aGroup >>= xGroup; @@ -144,13 +144,13 @@ IMPL_LINK_NOARG(SwVisitingCardPage, FrameControlInitializedHdl) IMPL_LINK( SwVisitingCardPage, AutoTextSelectHdl, void*, pBox ) { - if(_xAutoText.is()) + if(m_xAutoText.is()) { if( &aAutoTextGroupLB == pBox ) { String sGroup( *(String*)aAutoTextGroupLB.GetEntryData( aAutoTextGroupLB.GetSelectEntryPos())); - uno::Any aGroup = _xAutoText->getByName(sGroup); + uno::Any aGroup = m_xAutoText->getByName(sGroup); uno::Reference< text::XAutoTextGroup > xGroup; aGroup >>= xGroup; diff --git a/sw/source/ui/envelp/swuilabimp.hxx b/sw/source/ui/envelp/swuilabimp.hxx index ace270d094f4..7b439450ed15 100644 --- a/sw/source/ui/envelp/swuilabimp.hxx +++ b/sw/source/ui/envelp/swuilabimp.hxx @@ -19,6 +19,7 @@ #ifndef _SWUILABIMP_HXX #define _SWUILABIMP_HXX #include "labimp.hxx" +#include <com/sun/star/text/XAutoTextContainer2.hpp> class SwLabPage : public SfxTabPage { @@ -103,7 +104,7 @@ class SwVisitingCardPage : public SfxTabPage SwLabItem aLabItem; SwOneExampleFrame* pExampleFrame; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > _xAutoText; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XAutoTextContainer2 > m_xAutoText; DECL_LINK( AutoTextSelectHdl, void* ); diff --git a/sw/source/ui/inc/glossary.hxx b/sw/source/ui/inc/glossary.hxx index afd47aa30999..3beb52ac1f7a 100644 --- a/sw/source/ui/inc/glossary.hxx +++ b/sw/source/ui/inc/glossary.hxx @@ -36,6 +36,7 @@ #include <com/sun/star/container/XEnumeration.hpp> #include <com/sun/star/container/XElementAccess.hpp> #include <com/sun/star/container/XIndexAccess.hpp> +#include <com/sun/star/text/XAutoTextContainer2.hpp> #include <actctrl.hxx> @@ -100,7 +101,7 @@ class SwGlossaryDlg : public SvxStandardDialog String sReadonlyPath; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > _xAutoText; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XAutoTextContainer2 > m_xAutoText; SwOneExampleFrame* pExampleFrame; SwGlossaryHdl* pGlossaryHdl; diff --git a/sw/source/ui/inc/unoatxt.hxx b/sw/source/ui/inc/unoatxt.hxx index e92962bec165..8813d430d11c 100644 --- a/sw/source/ui/inc/unoatxt.hxx +++ b/sw/source/ui/inc/unoatxt.hxx @@ -19,21 +19,19 @@ #ifndef _UNOATXT_HXX #define _UNOATXT_HXX -#include <com/sun/star/text/XAutoTextGroup.hpp> -#include <com/sun/star/text/XAutoTextEntry.hpp> -#include <com/sun/star/text/XAutoTextContainer.hpp> -#include <com/sun/star/text/XText.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/container/XNamed.hpp> +#include <com/sun/star/document/XEventsSupplier.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> -#include <com/sun/star/container/XNamed.hpp> -#include <com/sun/star/container/XIndexAccess.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/document/XEventsSupplier.hpp> +#include <com/sun/star/text/XAutoTextGroup.hpp> +#include <com/sun/star/text/XAutoTextEntry.hpp> +#include <com/sun/star/text/XAutoTextContainer2.hpp> +#include <com/sun/star/text/XText.hpp> #include <svl/itemprop.hxx> #include <svl/lstner.hxx> -#include <cppuhelper/implbase3.hxx> // helper for implementations -#include <cppuhelper/implbase4.hxx> // helper for implementations +#include <cppuhelper/implbase2.hxx> // helper for implementations #include <cppuhelper/implbase5.hxx> // helper for implementations #include <cppuhelper/implbase6.hxx> // helper for implementations #include <svtools/unoevent.hxx> @@ -53,11 +51,10 @@ SV_DECL_REF( SwDocShell ) SAL_CALL SwXAutoTextContainer_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & ) throw ( ::com::sun::star::uno::Exception ); -class SwXAutoTextContainer : public cppu::WeakImplHelper3 +class SwXAutoTextContainer : public cppu::WeakImplHelper2 < - ::com::sun::star::text::XAutoTextContainer, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::container::XIndexAccess + ::com::sun::star::text::XAutoTextContainer2, + ::com::sun::star::lang::XServiceInfo > { SwGlossaries *pGlossaries; diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index ee5a1c077a22..02fe69133241 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -37,6 +37,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> #include <ucbhelper/content.hxx> +#include <com/sun/star/text/AutoTextContainer.hpp> #include <com/sun/star/ui/dialogs/XFilePicker.hpp> #include <com/sun/star/ui/dialogs/XFilterManager.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> @@ -1132,19 +1133,17 @@ void SwGlossaryDlg::ShowAutoText(const String& rGroup, const String& rShortName) } } -void SwGlossaryDlg::ResumeShowAutoText() +void SwGlossaryDlg::ResumeShowAutoText() { String sGroup, sShortName; if(GetResumeData(sGroup, sShortName) && m_pExampleWIN->IsVisible()) { - if(!_xAutoText.is()) + if(!m_xAutoText.is()) { - uno::Reference< lang::XMultiServiceFactory > - xMgr = getProcessServiceFactory(); + uno::Reference< lang::XMultiServiceFactory > xMgr = getProcessServiceFactory(); //now the AutoText ListBoxes have to be filled - uno::Reference< uno::XInterface > xAText = xMgr->createInstance( "com.sun.star.text.AutoTextContainer" ); - _xAutoText = uno::Reference< container::XNameAccess >(xAText, uno::UNO_QUERY); + m_xAutoText = text::AutoTextContainer::create( comphelper::getComponentContext(xMgr) ); } uno::Reference< XTextCursor > & xCrsr = pExampleFrame->GetTextCursor(); @@ -1152,7 +1151,7 @@ void SwGlossaryDlg::ResumeShowAutoText() { if(sShortName.Len()) { - uno::Any aGroup = _xAutoText->getByName(sGroup); + uno::Any aGroup = m_xAutoText->getByName(sGroup); uno::Reference< XAutoTextGroup > xGroup; OUString uShortName(sShortName); if((aGroup >>= xGroup) && xGroup->hasByName(uShortName)) diff --git a/sw/source/ui/vba/vbatemplate.cxx b/sw/source/ui/vba/vbatemplate.cxx index 8a01bc26dfdb..e17a2fc87c9c 100644 --- a/sw/source/ui/vba/vbatemplate.cxx +++ b/sw/source/ui/vba/vbatemplate.cxx @@ -20,7 +20,7 @@ #include <vbahelper/vbahelper.hxx> #include "wordvbahelper.hxx" #include "vbaautotextentry.hxx" -#include <com/sun/star/text/XAutoTextContainer.hpp> +#include <com/sun/star/text/AutoTextContainer.hpp> #include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> #include <tools/urlobj.hxx> @@ -85,8 +85,8 @@ SwVbaTemplate::getPath() throw ( css::uno::RuntimeException ) uno::Any SAL_CALL SwVbaTemplate::AutoTextEntries( const uno::Any& index ) throw (uno::RuntimeException) { - uno::Reference< lang::XMultiServiceFactory > xMgr = comphelper::getProcessServiceFactory(); - uno::Reference< text::XAutoTextContainer > xAutoTextContainer( xMgr->createInstance( rtl::OUString("com.sun.star.text.AutoTextContainer") ), uno::UNO_QUERY_THROW ); + uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); + uno::Reference< text::XAutoTextContainer2 > xAutoTextContainer = text::AutoTextContainer::create( xContext ); // the default template is "Normal.dot" in Word. rtl::OUString sGroup("Normal"); |