Kaydet (Commit) 7f8e721e authored tarafından Thomas Arnhold's avatar Thomas Arnhold

sw: remove macros

Change-Id: Iec447843f4f314bbd562f2e4821b4bcfadeeb565
üst 17533a0f
......@@ -49,14 +49,9 @@
#include "drpcps.hrc"
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
//using namespace i18n; !using this namespace leads to mysterious conflicts with ScriptType::...!
// so don't use this instead of the following defines!
#define I18N ::com::sun::star::i18n
#define I18N_SCRIPTTYPE ::com::sun::star::i18n::ScriptType
using namespace css;
using namespace css::uno;
using namespace css::lang;
// Globals ******************************************************************
......@@ -95,7 +90,7 @@ class SwDropCapsPict : public Control
SvxFont maCJKFont;
SvxFont maCTLFont;
Size maTextSize;
Reference< I18N::XBreakIterator > xBreak;
Reference< css::i18n::XBreakIterator > xBreak;
virtual void Paint(const Rectangle &rRect);
void CheckScript( void );
......@@ -200,7 +195,7 @@ void SwDropCapsPict::GetFirstScriptSegment(xub_StrLen &start, xub_StrLen &end, s
if( maScriptChanges.empty() )
{
end = maText.Len();
scriptType = I18N_SCRIPTTYPE::LATIN;
scriptType = css::i18n::ScriptType::LATIN;
}
else
{
......@@ -380,7 +375,7 @@ void SwDropCapsPict::DrawPrev( const Point& rPt )
GetFirstScriptSegment(nStart, nEnd, nScript);
do
{
SvxFont& rFnt = (nScript==I18N_SCRIPTTYPE::ASIAN) ? maCJKFont : ((nScript==I18N_SCRIPTTYPE::COMPLEX) ? maCTLFont : maFont);
SvxFont& rFnt = (nScript==css::i18n::ScriptType::ASIAN) ? maCJKFont : ((nScript==css::i18n::ScriptType::COMPLEX) ? maCTLFont : maFont);
mpPrinter->SetFont( rFnt );
rFnt.DrawPrev( this, mpPrinter, aPt, maText, nStart, nEnd - nStart );
......@@ -403,17 +398,17 @@ void SwDropCapsPict::CheckScript( void )
if( !xBreak.is() )
{
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
xBreak = I18N::BreakIterator::create(xContext);
xBreak = css::i18n::BreakIterator::create(xContext);
}
sal_uInt16 nScript = xBreak->getScriptType( maText, 0 );
sal_uInt16 nChg = 0;
if( I18N_SCRIPTTYPE::WEAK == nScript )
if( css::i18n::ScriptType::WEAK == nScript )
{
nChg = (xub_StrLen)xBreak->endOfScript( maText, nChg, nScript );
if( nChg < maText.Len() )
nScript = xBreak->getScriptType( maText, nChg );
else
nScript = I18N_SCRIPTTYPE::LATIN;
nScript = css::i18n::ScriptType::LATIN;
}
do
......@@ -446,8 +441,8 @@ Size SwDropCapsPict::CalcTextSize( void )
long nCTLAscent = 0;
do
{
SvxFont& rFnt = ( nScript == I18N_SCRIPTTYPE::ASIAN )? maCJKFont :
( ( nScript == I18N_SCRIPTTYPE::COMPLEX )? maCTLFont : maFont );
SvxFont& rFnt = ( nScript == css::i18n::ScriptType::ASIAN )? maCJKFont :
( ( nScript == css::i18n::ScriptType::COMPLEX )? maCTLFont : maFont );
sal_uLong nWidth = rFnt.GetTxtSize( mpPrinter, maText, nStart, nEnd-nStart ).Width();
if( nIdx < maScriptChanges.size() )
......@@ -455,10 +450,10 @@ Size SwDropCapsPict::CalcTextSize( void )
nTxtWidth += nWidth;
switch(nScript)
{
case I18N_SCRIPTTYPE::ASIAN:
case css::i18n::ScriptType::ASIAN:
calcFontHeightAnyAscent( this, maCJKFont, nCJKHeight, nCJKAscent );
break;
case I18N_SCRIPTTYPE::COMPLEX:
case css::i18n::ScriptType::COMPLEX:
calcFontHeightAnyAscent( this, maCTLFont, nCTLHeight, nCTLAscent );
break;
default:
......
......@@ -131,7 +131,6 @@ extern bool bExecuteDrag;
#define SWTRANSFER_GRAPHIC_INSERTED 0x00000040
using namespace ::svx;
using ::rtl::OUString;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::datatransfer;
......@@ -370,7 +369,7 @@ namespace
}
}
sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
sal_Bool SwTransferable::GetData( const DataFlavor& rFlavor )
{
sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor );
......@@ -574,7 +573,7 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream,
void* pObject, sal_uInt32 nObjectType,
const DATA_FLAVOR& /*rFlavor*/ )
const DataFlavor& /*rFlavor*/ )
{
sal_Bool bRet = sal_False;
WriterRef xWrt;
......@@ -1768,7 +1767,7 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
// insert replacement image ( if there is one ) into the object helper
if ( nGrFormat )
{
datatransfer::DataFlavor aDataFlavor;
DataFlavor aDataFlavor;
SotExchange::GetFormatDataFlavor( nGrFormat, aDataFlavor );
xObjRef.SetGraphic( aGraphic, aDataFlavor.MimeType );
}
......@@ -3383,8 +3382,7 @@ void SwTransferable::CreateSelection( SwWrtShell& rSh,
pNew->pCreatorView = _pCreatorView;
uno::Reference<
datatransfer::XTransferable > xRef( pNew );
uno::Reference< XTransferable > xRef( pNew );
pMod->pXSelection = pNew;
pNew->CopyToSelection( rSh.GetWin() );
}
......
......@@ -52,7 +52,6 @@ namespace nsTransferBufferType
const sal_uInt16 TRNSFR_DRAWING = 0x0081; // drawing is internal too!
}
#define DATA_FLAVOR ::com::sun::star::datatransfer::DataFlavor
class SwTransferable : public TransferableHelper
{
......@@ -78,7 +77,7 @@ class SwTransferable : public TransferableHelper
sal_Bool bCleanUp :1; //D&D cleanup after Drop (not by internal Drop)
// helper methods for the copy
com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > FindOLEObj( sal_Int64& nAspect ) const;
css::uno::Reference < css::embed::XEmbeddedObject > FindOLEObj( sal_Int64& nAspect ) const;
const Graphic* FindOLEReplacementGraphic() const;
void DeleteSelection();
......@@ -139,11 +138,11 @@ class SwTransferable : public TransferableHelper
protected:
virtual void AddSupportedFormats();
virtual sal_Bool GetData( const DATA_FLAVOR& rFlavor );
virtual sal_Bool GetData( const css::datatransfer::DataFlavor& rFlavor );
virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm,
void* pUserObject,
sal_uInt32 nUserObjectId,
const DATA_FLAVOR& rFlavor );
const css::datatransfer::DataFlavor& rFlavor );
virtual void DragFinished( sal_Int8 nDropAction );
virtual void ObjectReleased();
......@@ -205,9 +204,9 @@ public:
// the related SwView is being closed and the SwTransferable is invalid now
void Invalidate() {pWrtShell = 0;}
static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( ::com::sun::star::uno::RuntimeException );
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rId ) throw( css::uno::RuntimeException );
};
......
This diff is collapsed.
......@@ -55,16 +55,12 @@ namespace com
class SfxMedium;
class SfxFilter;
#define REFERENCE ::com::sun::star::uno::Reference
#define SEQUENCE ::com::sun::star::uno::Sequence
#define RUNTIME_EXCEPTION ::com::sun::star::uno::RuntimeException
class SwFilterDetect : public ::cppu::WeakImplHelper2< ::com::sun::star::document::XExtendedFilterDetection, ::com::sun::star::lang::XServiceInfo >
class SwFilterDetect : public ::cppu::WeakImplHelper2< css::document::XExtendedFilterDetection, css::lang::XServiceInfo >
{
static sal_uLong DetectFilter( SfxMedium& rMedium, const SfxFilter** ppFilter );
static sal_uLong GlobDetectFilter( SfxMedium& rMedium, const SfxFilter** ppFilter );
public:
SwFilterDetect( const REFERENCE < ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
SwFilterDetect( const css::uno::Reference < css::lang::XMultiServiceFactory >& xFactory );
virtual ~SwFilterDetect();
SFX_DECL_XSERVICEINFO_NOFACTORY
......@@ -72,7 +68,7 @@ public:
//----------------------------------------------------------------------------------
// XExtendedFilterDetect
//----------------------------------------------------------------------------------
virtual ::rtl::OUString SAL_CALL detect( SEQUENCE< ::com::sun::star::beans::PropertyValue >& lDescriptor ) throw( RUNTIME_EXCEPTION );
virtual ::rtl::OUString SAL_CALL detect( css::uno::Sequence< css::beans::PropertyValue >& lDescriptor ) throw( css::uno::RuntimeException );
};
#endif
......
......@@ -29,17 +29,17 @@
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
using namespace css;
::rtl::OUString SAL_CALL SwUnoModule_getImplementationName() throw( uno::RuntimeException )
OUString SAL_CALL SwUnoModule_getImplementationName() throw( uno::RuntimeException )
{
return rtl::OUString( "com.sun.star.comp.Writer.WriterModule" );
return OUString( "com.sun.star.comp.Writer.WriterModule" );
}
uno::Sequence< rtl::OUString > SAL_CALL SwUnoModule_getSupportedServiceNames() throw( uno::RuntimeException )
uno::Sequence< OUString > SAL_CALL SwUnoModule_getSupportedServiceNames() throw( uno::RuntimeException )
{
uno::Sequence< rtl::OUString > aSeq( 1 );
aSeq[0] = ::rtl::OUString("com.sun.star.text.ModuleDispatcher");
uno::Sequence< OUString > aSeq( 1 );
aSeq[0] = OUString("com.sun.star.text.ModuleDispatcher");
return aSeq;
}
......@@ -102,11 +102,11 @@ void SAL_CALL SwUnoModule::removeStatusListener(
{
}
SEQUENCE< REFERENCE< XDISPATCH > > SAL_CALL SwUnoModule::queryDispatches(
const SEQUENCE< DISPATCHDESCRIPTOR >& seqDescripts ) throw( uno::RuntimeException )
uno::Sequence< uno::Reference< frame::XDispatch > > SAL_CALL SwUnoModule::queryDispatches(
const uno::Sequence< frame::DispatchDescriptor >& seqDescripts ) throw( uno::RuntimeException )
{
sal_Int32 nCount = seqDescripts.getLength();
SEQUENCE< REFERENCE< XDISPATCH > > lDispatcher( nCount );
uno::Sequence< uno::Reference< frame::XDispatch > > lDispatcher( nCount );
for( sal_Int32 i=0; i<nCount; ++i )
{
......@@ -119,31 +119,31 @@ SEQUENCE< REFERENCE< XDISPATCH > > SAL_CALL SwUnoModule::queryDispatches(
}
// XDispatchProvider
REFERENCE< XDISPATCH > SAL_CALL SwUnoModule::queryDispatch(
const UNOURL& aURL, const rtl::OUString& /*sTargetFrameName*/,
uno::Reference< frame::XDispatch > SAL_CALL SwUnoModule::queryDispatch(
const util::URL& aURL, const OUString& /*sTargetFrameName*/,
sal_Int32 /*eSearchFlags*/ ) throw( uno::RuntimeException )
{
REFERENCE< XDISPATCH > xReturn;
uno::Reference< frame::XDispatch > xReturn;
SolarMutexGuard aGuard;
SwGlobals::ensure();
const SfxSlot* pSlot = SW_MOD()->GetInterface()->GetSlot( aURL.Complete );
if ( pSlot )
xReturn = REFERENCE< XDISPATCH >(static_cast< XDISPATCH* >(this), uno::UNO_QUERY);
xReturn = uno::Reference< frame::XDispatch >(static_cast< frame::XDispatch* >(this), uno::UNO_QUERY);
return xReturn;
}
// XServiceInfo
::rtl::OUString SAL_CALL SwUnoModule::getImplementationName( ) throw(uno::RuntimeException)
OUString SAL_CALL SwUnoModule::getImplementationName( ) throw(uno::RuntimeException)
{
return SwUnoModule_getImplementationName();
}
sal_Bool SAL_CALL SwUnoModule::supportsService( const ::rtl::OUString& sServiceName ) throw(uno::RuntimeException)
sal_Bool SAL_CALL SwUnoModule::supportsService( const OUString& sServiceName ) throw(uno::RuntimeException)
{
UNOSEQUENCE< rtl::OUString > seqServiceNames = getSupportedServiceNames();
const rtl::OUString* pArray = seqServiceNames.getConstArray();
uno::Sequence< OUString > seqServiceNames = getSupportedServiceNames();
const OUString* pArray = seqServiceNames.getConstArray();
for ( sal_Int32 nCounter=0; nCounter<seqServiceNames.getLength(); nCounter++ )
{
if ( pArray[nCounter] == sServiceName )
......@@ -154,7 +154,7 @@ sal_Bool SAL_CALL SwUnoModule::supportsService( const ::rtl::OUString& sServiceN
return sal_False ;
}
uno::Sequence< ::rtl::OUString > SAL_CALL SwUnoModule::getSupportedServiceNames( ) throw(uno::RuntimeException)
uno::Sequence< OUString > SAL_CALL SwUnoModule::getSupportedServiceNames( ) throw(uno::RuntimeException)
{
return SwUnoModule_getSupportedServiceNames();
}
......
......@@ -48,42 +48,32 @@ namespace com
}
}
#define REFERENCE ::com::sun::star::uno::Reference
#define SEQUENCE ::com::sun::star::uno::Sequence
#define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException
#define REFERENCE ::com::sun::star::uno::Reference
#define SEQUENCE ::com::sun::star::uno::Sequence
#define XDISPATCH ::com::sun::star::frame::XDispatch
#define XNOTIFYINGDISPATCH ::com::sun::star::frame::XNotifyingDispatch
#define UNOURL ::com::sun::star::util::URL
#define DISPATCHDESCRIPTOR ::com::sun::star::frame::DispatchDescriptor
class SwUnoModule : public ::cppu::WeakImplHelper3< ::com::sun::star::frame::XDispatchProvider, ::com::sun::star::frame::XNotifyingDispatch, ::com::sun::star::lang::XServiceInfo >
class SwUnoModule : public ::cppu::WeakImplHelper3< css::frame::XDispatchProvider, css::frame::XNotifyingDispatch, css::lang::XServiceInfo >
{
REFERENCE < ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
css::uno::Reference < css::lang::XMultiServiceFactory > m_xFactory;
public:
SwUnoModule( const REFERENCE < ::com::sun::star::lang::XMultiServiceFactory >& xFactory )
SwUnoModule( const css::uno::Reference < css::lang::XMultiServiceFactory >& xFactory )
: m_xFactory( xFactory )
{}
// XNotifyingDispatch
virtual void SAL_CALL dispatchWithNotification( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchResultListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL dispatchWithNotification( const css::util::URL& aURL, const css::uno::Sequence< css::beans::PropertyValue >& aArgs, const css::uno::Reference< css::frame::XDispatchResultListener >& xListener ) throw (css::uno::RuntimeException);
// XDispatch
virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs ) throw( ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xControl, const ::com::sun::star::util::URL& aURL) throw( ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL removeStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xControl, const ::com::sun::star::util::URL& aURL) throw( ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL dispatch( const css::util::URL& aURL, const css::uno::Sequence< css::beans::PropertyValue >& aArgs ) throw( css::uno::RuntimeException );
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > & xControl, const css::util::URL& aURL) throw( css::uno::RuntimeException );
virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > & xControl, const css::util::URL& aURL) throw( css::uno::RuntimeException );
// XDispatchProvider
virtual SEQUENCE< REFERENCE< XDISPATCH > > SAL_CALL queryDispatches( const SEQUENCE< DISPATCHDESCRIPTOR >& seqDescriptor ) throw( RUNTIMEEXCEPTION ) ;
virtual REFERENCE< XDISPATCH > SAL_CALL queryDispatch( const UNOURL & aURL ,
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& seqDescriptor ) throw( css::uno::RuntimeException ) ;
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL & aURL ,
const ::rtl::OUString & sTargetFrameName,
sal_Int32 eSearchFlags ) throw( RUNTIMEEXCEPTION ) ;
sal_Int32 eSearchFlags ) throw( css::uno::RuntimeException ) ;
// XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(css::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(css::uno::RuntimeException);
virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(css::uno::RuntimeException);
};
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment