diff options
author | Jean-Noël Rouvignac <jn.rouvignac@gmail.com> | 2013-01-30 11:44:23 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-01-30 12:54:40 +0000 |
commit | 97eb8a6e0eb830f37dcba64a51d725aab4c5ff53 (patch) | |
tree | a1a95b8249052d846a997ad1729758168d6a3b24 /sdext | |
parent | UNO constants cannot be of CHAR type (diff) | |
download | core-97eb8a6e0eb830f37dcba64a51d725aab4c5ff53.tar.gz core-97eb8a6e0eb830f37dcba64a51d725aab4c5ff53.zip |
Removed several useless macros: A2OU, A2S, C2U, C2S, OUSTR, OUSTRING
Change-Id: Ie859cb2dfdc7103c379fce56be88eef8fe390afd
Reviewed-on: https://gerrit.libreoffice.org/1924
Tested-by: Luboš Luňák <l.lunak@suse.cz>
Reviewed-by: Luboš Luňák <l.lunak@suse.cz>
Diffstat (limited to 'sdext')
20 files changed, 209 insertions, 248 deletions
diff --git a/sdext/source/presenter/PresenterAccessibility.cxx b/sdext/source/presenter/PresenterAccessibility.cxx index 9bf043454a58..59d2396c6117 100644 --- a/sdext/source/presenter/PresenterAccessibility.cxx +++ b/sdext/source/presenter/PresenterAccessibility.cxx @@ -48,8 +48,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::drawing::framework; using ::rtl::OUString; -#define A2S(s) (::rtl::OUString(s)) - //===== PresenterAccessibleObject ============================================= namespace sdext { namespace presenter { @@ -432,12 +430,12 @@ public: const css::uno::Reference<css::uno::XComponentContext>& rxContext, const lang::Locale aLocale) { - OUString sName (A2S("Presenter Console")); + OUString sName ("Presenter Console"); PresenterConfigurationAccess aConfiguration ( rxContext, OUString("/org.openoffice.Office.PresenterScreen/"), PresenterConfigurationAccess::READ_ONLY); - aConfiguration.GetConfigurationNode(A2S("Presenter/Accessibility/Console/String")) + aConfiguration.GetConfigurationNode("Presenter/Accessibility/Console/String") >>= sName; rtl::Reference<PresenterAccessible::AccessibleObject> pObject ( @@ -461,13 +459,13 @@ public: const Reference<awt::XWindow>& rxContentWindow, const Reference<awt::XWindow>& rxBorderWindow) { - OUString sName (A2S("Presenter Notes Window")); + OUString sName ("Presenter Notes Window"); { PresenterConfigurationAccess aConfiguration ( rxContext, OUString("/org.openoffice.Office.PresenterScreen/"), PresenterConfigurationAccess::READ_ONLY); - aConfiguration.GetConfigurationNode(A2S("Presenter/Accessibility/Preview/String")) + aConfiguration.GetConfigurationNode("Presenter/Accessibility/Preview/String") >>= sName; } @@ -1376,7 +1374,7 @@ void PresenterAccessible::AccessibleObject::ThrowException ( const sal_Char* pMessage, const ExceptionType eExceptionType) const { - const OUString sMessage (OUString(A2S("PresenterAccessible: ")) + OUString::createFromAscii(pMessage)); + const OUString sMessage ("PresenterAccessible: " + OUString::createFromAscii(pMessage)); const Reference<XInterface> xObject ( const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this))); switch (eExceptionType) @@ -1407,7 +1405,7 @@ sal_uInt32 AccessibleStateSet::GetStateMask (const sal_Int16 nState) { if (nState<0 || nState>=sal_Int16(sizeof(sal_uInt32)*8)) { - throw RuntimeException(A2S("AccessibleStateSet::GetStateMask: invalid state"), NULL); + throw RuntimeException("AccessibleStateSet::GetStateMask: invalid state", NULL); } return 1<<nState; @@ -1882,13 +1880,13 @@ rtl::Reference<PresenterAccessible::AccessibleObject> AccessibleNotes::Create ( const Reference<awt::XWindow>& rxBorderWindow, const ::boost::shared_ptr<PresenterTextView>& rpTextView) { - OUString sName (A2S("Presenter Notes Text")); + OUString sName ("Presenter Notes Text"); { PresenterConfigurationAccess aConfiguration ( rxContext, OUString("/org.openoffice.Office.PresenterScreen/"), PresenterConfigurationAccess::READ_ONLY); - aConfiguration.GetConfigurationNode(A2S("Presenter/Accessibility/Notes/String")) + aConfiguration.GetConfigurationNode("Presenter/Accessibility/Notes/String") >>= sName; } @@ -1931,7 +1929,7 @@ void AccessibleNotes::SetTextView ( new PresenterAccessible::AccessibleParagraph( css::lang::Locale(), AccessibleRole::PARAGRAPH, - A2S("Paragraph")+OUString::valueOf(nIndex), + "Paragraph"+OUString::valueOf(nIndex), rpTextView->GetParagraph(nIndex), nIndex)); pParagraph->LateInitialization(); diff --git a/sdext/source/presenter/PresenterBitmapContainer.cxx b/sdext/source/presenter/PresenterBitmapContainer.cxx index 30e4eaf25ff9..66d0cf86a25a 100644 --- a/sdext/source/presenter/PresenterBitmapContainer.cxx +++ b/sdext/source/presenter/PresenterBitmapContainer.cxx @@ -33,8 +33,6 @@ using namespace ::com::sun::star::uno; using namespace ::std; using ::rtl::OUString; -#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString))) - namespace sdext { namespace presenter { //===== PresenterBitmapContainer ============================================== @@ -55,7 +53,7 @@ PresenterBitmapContainer::PresenterBitmapContainer ( // Get access to the configuration. PresenterConfigurationAccess aConfiguration ( rxComponentContext, - A2S("org.openoffice.Office.PresenterScreen"), + "org.openoffice.Office.PresenterScreen", PresenterConfigurationAccess::READ_ONLY); Reference<container::XNameAccess> xBitmapList ( aConfiguration.GetConfigurationNode(rsConfigurationBase), @@ -93,7 +91,7 @@ void PresenterBitmapContainer::Initialize ( return; mxPresenterHelper = Reference<drawing::XPresenterHelper>( xFactory->createInstanceWithContext( - A2S("com.sun.star.drawing.PresenterHelper"), + "com.sun.star.drawing.PresenterHelper", rxComponentContext), UNO_QUERY_THROW); } @@ -178,7 +176,7 @@ void PresenterBitmapContainer::ProcessBitmap ( const Reference<beans::XPropertySet>& rxProperties) { OUString sName; - if ( ! (PresenterConfigurationAccess::GetProperty(rxProperties, A2S("Name")) >>= sName)) + if ( ! (PresenterConfigurationAccess::GetProperty(rxProperties, "Name") >>= sName)) sName = rsKey; maIconContainer[sName] = LoadBitmap( @@ -205,7 +203,7 @@ SharedBitmapDescriptor PresenterBitmapContainer::LoadBitmap ( OUString sFileName; // Load bitmaps. - if (PresenterConfigurationAccess::GetProperty(rxProperties, A2S("NormalFileName")) >>= sFileName) + if (PresenterConfigurationAccess::GetProperty(rxProperties, "NormalFileName") >>= sFileName) try { pBitmap->SetBitmap( @@ -214,7 +212,7 @@ SharedBitmapDescriptor PresenterBitmapContainer::LoadBitmap ( } catch (Exception&) {} - if (PresenterConfigurationAccess::GetProperty(rxProperties, A2S("MouseOverFileName")) >>= sFileName) + if (PresenterConfigurationAccess::GetProperty(rxProperties, "MouseOverFileName") >>= sFileName) try { pBitmap->SetBitmap( @@ -223,7 +221,7 @@ SharedBitmapDescriptor PresenterBitmapContainer::LoadBitmap ( } catch (Exception&) {} - if (PresenterConfigurationAccess::GetProperty(rxProperties, A2S("ButtonDownFileName")) >>= sFileName) + if (PresenterConfigurationAccess::GetProperty(rxProperties, "ButtonDownFileName") >>= sFileName) try { pBitmap->SetBitmap( @@ -232,7 +230,7 @@ SharedBitmapDescriptor PresenterBitmapContainer::LoadBitmap ( } catch (Exception&) {} - if (PresenterConfigurationAccess::GetProperty(rxProperties, A2S("DisabledFileName")) >>= sFileName) + if (PresenterConfigurationAccess::GetProperty(rxProperties, "DisabledFileName") >>= sFileName) try { pBitmap->SetBitmap( @@ -241,7 +239,7 @@ SharedBitmapDescriptor PresenterBitmapContainer::LoadBitmap ( } catch (Exception&) {} - if (PresenterConfigurationAccess::GetProperty(rxProperties, A2S("MaskFileName")) >>= sFileName) + if (PresenterConfigurationAccess::GetProperty(rxProperties, "MaskFileName") >>= sFileName) try { pBitmap->SetBitmap( @@ -251,18 +249,18 @@ SharedBitmapDescriptor PresenterBitmapContainer::LoadBitmap ( catch (Exception&) {} - PresenterConfigurationAccess::GetProperty(rxProperties, A2S("XOffset")) >>= pBitmap->mnXOffset; - PresenterConfigurationAccess::GetProperty(rxProperties, A2S("YOffset")) >>= pBitmap->mnYOffset; + PresenterConfigurationAccess::GetProperty(rxProperties, "XOffset") >>= pBitmap->mnXOffset; + PresenterConfigurationAccess::GetProperty(rxProperties, "YOffset") >>= pBitmap->mnYOffset; - PresenterConfigurationAccess::GetProperty(rxProperties, A2S("XHotSpot")) >>= pBitmap->mnXHotSpot; - PresenterConfigurationAccess::GetProperty(rxProperties, A2S("YHotSpot")) >>= pBitmap->mnYHotSpot; + PresenterConfigurationAccess::GetProperty(rxProperties, "XHotSpot") >>= pBitmap->mnXHotSpot; + PresenterConfigurationAccess::GetProperty(rxProperties, "YHotSpot") >>= pBitmap->mnYHotSpot; - PresenterConfigurationAccess::GetProperty(rxProperties, A2S("ReplacementColor")) >>= pBitmap->maReplacementColor; + PresenterConfigurationAccess::GetProperty(rxProperties, "ReplacementColor") >>= pBitmap->maReplacementColor; OUString sTexturingMode; - if (PresenterConfigurationAccess::GetProperty(rxProperties, A2S("HorizontalTexturingMode")) >>= sTexturingMode) + if (PresenterConfigurationAccess::GetProperty(rxProperties, "HorizontalTexturingMode") >>= sTexturingMode) pBitmap->meHorizontalTexturingMode = StringToTexturingMode(sTexturingMode); - if (PresenterConfigurationAccess::GetProperty(rxProperties, A2S("VerticalTexturingMode")) >>= sTexturingMode) + if (PresenterConfigurationAccess::GetProperty(rxProperties, "VerticalTexturingMode") >>= sTexturingMode) pBitmap->meVerticalTexturingMode = StringToTexturingMode(sTexturingMode); return pBitmap; @@ -271,11 +269,11 @@ SharedBitmapDescriptor PresenterBitmapContainer::LoadBitmap ( PresenterBitmapContainer::BitmapDescriptor::TexturingMode PresenterBitmapContainer::StringToTexturingMode (const OUString& rsTexturingMode) { - if (rsTexturingMode == A2S("Once")) + if (rsTexturingMode == "Once") return PresenterBitmapContainer::BitmapDescriptor::Once; - else if (rsTexturingMode == A2S("Repeat")) + else if (rsTexturingMode == "Repeat") return PresenterBitmapContainer::BitmapDescriptor::Repeat; - else if (rsTexturingMode == A2S("Stretch")) + else if (rsTexturingMode == "Stretch") return PresenterBitmapContainer::BitmapDescriptor::Stretch; else return PresenterBitmapContainer::BitmapDescriptor::Once; diff --git a/sdext/source/presenter/PresenterButton.cxx b/sdext/source/presenter/PresenterButton.cxx index b7415a538243..bc9a1274a4d0 100644 --- a/sdext/source/presenter/PresenterButton.cxx +++ b/sdext/source/presenter/PresenterButton.cxx @@ -35,8 +35,6 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using ::rtl::OUString; -#define A2S(pString) (::rtl::OUString(pString)) - namespace sdext { namespace presenter { const static double gnHorizontalBorder (15); @@ -57,16 +55,16 @@ const static double gnVerticalBorder (5); { OUString sText; OUString sAction; - PresenterConfigurationAccess::GetProperty(xProperties, A2S("Text")) >>= sText; - PresenterConfigurationAccess::GetProperty(xProperties, A2S("Action")) >>= sAction; + PresenterConfigurationAccess::GetProperty(xProperties, "Text") >>= sText; + PresenterConfigurationAccess::GetProperty(xProperties, "Action") >>= sAction; PresenterTheme::SharedFontDescriptor pFont; if (rpTheme.get() != NULL) - pFont = rpTheme->GetFont(A2S("ButtonFont")); + pFont = rpTheme->GetFont("ButtonFont"); PresenterTheme::SharedFontDescriptor pMouseOverFont; if (rpTheme.get() != NULL) - pMouseOverFont = rpTheme->GetFont(A2S("ButtonMouseOverFont")); + pMouseOverFont = rpTheme->GetFont("ButtonMouseOverFont"); rtl::Reference<PresenterButton> pButton ( new PresenterButton( @@ -450,9 +448,9 @@ void PresenterButton::SetupButtonBitmaps (void) return; // Get the bitmaps for the button border. - SharedBitmapDescriptor pLeftBitmap (mpTheme->GetBitmap(A2S("ButtonFrameLeft"))); - SharedBitmapDescriptor pCenterBitmap(mpTheme->GetBitmap(A2S("ButtonFrameCenter"))); - SharedBitmapDescriptor pRightBitmap(mpTheme->GetBitmap(A2S("ButtonFrameRight"))); + SharedBitmapDescriptor pLeftBitmap (mpTheme->GetBitmap("ButtonFrameLeft")); + SharedBitmapDescriptor pCenterBitmap(mpTheme->GetBitmap("ButtonFrameCenter")); + SharedBitmapDescriptor pRightBitmap(mpTheme->GetBitmap("ButtonFrameRight")); maButtonSize = CalculateButtonSize(); @@ -497,11 +495,11 @@ Reference<beans::XPropertySet> PresenterButton::GetConfigurationProperties ( return Reference<beans::XPropertySet>( PresenterConfigurationAccess::Find ( Reference<container::XNameAccess>( - aConfiguration.GetConfigurationNode(A2S("PresenterScreenSettings/Buttons")), + aConfiguration.GetConfigurationNode("PresenterScreenSettings/Buttons"), UNO_QUERY), ::boost::bind(&PresenterConfigurationAccess::IsStringPropertyEqual, rsConfgurationName, - A2S("Name"), + OUString::createFromAscii("Name"), _2)), UNO_QUERY); } diff --git a/sdext/source/presenter/PresenterConfigurationAccess.cxx b/sdext/source/presenter/PresenterConfigurationAccess.cxx index 5fdb8bc5d026..be5d839af0bf 100644 --- a/sdext/source/presenter/PresenterConfigurationAccess.cxx +++ b/sdext/source/presenter/PresenterConfigurationAccess.cxx @@ -29,12 +29,10 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using ::rtl::OUString; -#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString))) - namespace sdext { namespace presenter { const ::rtl::OUString PresenterConfigurationAccess::msPresenterScreenRootName = - A2S("/org.openoffice.Office.PresenterScreen/"); + "/org.openoffice.Office.PresenterScreen/"; PresenterConfigurationAccess::PresenterConfigurationAccess ( const Reference<XComponentContext>& rxContext, @@ -49,26 +47,26 @@ PresenterConfigurationAccess::PresenterConfigurationAccess ( { Sequence<Any> aCreationArguments(3); aCreationArguments[0] = makeAny(beans::PropertyValue( - A2S("nodepath"), + "nodepath", 0, makeAny(rsRootName), beans::PropertyState_DIRECT_VALUE)); aCreationArguments[1] = makeAny(beans::PropertyValue( - A2S("depth"), + "depth", 0, makeAny((sal_Int32)-1), beans::PropertyState_DIRECT_VALUE)); aCreationArguments[2] = makeAny(beans::PropertyValue( - A2S("lazywrite"), + "lazywrite", 0, makeAny(true), beans::PropertyState_DIRECT_VALUE)); OUString sAccessService; if (eMode == READ_ONLY) - sAccessService = A2S("com.sun.star.configuration.ConfigurationAccess"); + sAccessService = "com.sun.star.configuration.ConfigurationAccess"; else - sAccessService = A2S("com.sun.star.configuration.ConfigurationUpdateAccess"); + sAccessService = "com.sun.star.configuration.ConfigurationUpdateAccess"; Reference<lang::XMultiServiceFactory> xProvider = configuration::theDefaultProvider::get( rxContext ); diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx index 14820da65c3e..18d0aa943f17 100644 --- a/sdext/source/presenter/PresenterController.cxx +++ b/sdext/source/presenter/PresenterController.cxx @@ -69,8 +69,6 @@ namespace { const sal_Int32 ConfigurationUpdateEndEventType = 2; } -#define A2S(pString) (::rtl::OUString(pString)) - namespace sdext { namespace presenter { PresenterController::InstanceContainer PresenterController::maInstances; @@ -120,7 +118,7 @@ PresenterController::PresenterController ( if ( ! mxSlideShowController.is()) throw new lang::IllegalArgumentException( - A2S("missing slide show controller"), + "missing slide show controller", static_cast<XWeak*>(this), 2); @@ -133,15 +131,15 @@ PresenterController::PresenterController ( { mxConfigurationController->addConfigurationChangeListener( this, - A2S("ResourceActivation"), + "ResourceActivation", Any(ResourceActivationEventType)); mxConfigurationController->addConfigurationChangeListener( this, - A2S("ResourceDeactivation"), + "ResourceDeactivation", Any(ResourceDeactivationEventType)); mxConfigurationController->addConfigurationChangeListener( this, - A2S("ConfigurationUpdateEnd"), + "ConfigurationUpdateEnd", Any(ConfigurationUpdateEndEventType)); } @@ -162,7 +160,7 @@ PresenterController::PresenterController ( return; mxPresenterHelper = Reference<drawing::XPresenterHelper>( xFactory->createInstanceWithContext( - A2S("com.sun.star.drawing.PresenterHelper"), + "com.sun.star.drawing.PresenterHelper", rxContext), UNO_QUERY_THROW); @@ -173,7 +171,7 @@ PresenterController::PresenterController ( if (xProperties.is()) { Reference<awt::XWindow> xWindow ( - xProperties->getPropertyValue(A2S("ParentWindow")), UNO_QUERY); + xProperties->getPropertyValue("ParentWindow"), UNO_QUERY); if (xWindow.is()) xWindow->addKeyListener(this); } @@ -328,12 +326,12 @@ void PresenterController::UpdatePaneTitles (void) return; // Get placeholders and their values. - const OUString sCurrentSlideNumberPlaceholder (A2S("CURRENT_SLIDE_NUMBER")); - const OUString sCurrentSlideNamePlaceholder (A2S("CURRENT_SLIDE_NAME")); - const OUString sSlideCountPlaceholder (A2S("SLIDE_COUNT")); + const OUString sCurrentSlideNumberPlaceholder ("CURRENT_SLIDE_NUMBER"); + const OUString sCurrentSlideNamePlaceholder ("CURRENT_SLIDE_NAME"); + const OUString sSlideCountPlaceholder ("SLIDE_COUNT"); // Get string for slide count. - OUString sSlideCount (A2S("---")); + OUString sSlideCount ("---"); Reference<container::XIndexAccess> xIndexAccess(mxSlideShowController, UNO_QUERY); if (xIndexAccess.is()) sSlideCount = OUString::valueOf(xIndexAccess->getCount()); @@ -352,7 +350,7 @@ void PresenterController::UpdatePaneTitles (void) try { OUString sName; - if (xSlideProperties->getPropertyValue(A2S("LinkDisplayName")) >>= sName) + if (xSlideProperties->getPropertyValue("LinkDisplayName") >>= sName) { // Find out whether the name of the current slide has been // automatically created or has been set by the user. @@ -436,7 +434,7 @@ SharedBitmapDescriptor if (mpTheme.get() != NULL) { const OUString sStyleName (mpTheme->GetStyleName(rsViewURL)); - return mpTheme->GetBitmap(sStyleName, A2S("Background")); + return mpTheme->GetBitmap(sStyleName, "Background"); } return SharedBitmapDescriptor(); } @@ -1137,7 +1135,7 @@ void PresenterController::UpdatePendingSlideNumber (const sal_Int32 nPendingSlid return; PresenterTheme::SharedFontDescriptor pFont ( - mpTheme->GetFont(A2S("PendingSlideNumberFont"))); + mpTheme->GetFont("PendingSlideNumberFont")); if (pFont.get() == NULL) return; diff --git a/sdext/source/presenter/PresenterFrameworkObserver.cxx b/sdext/source/presenter/PresenterFrameworkObserver.cxx index dff6046580b3..0c318463a198 100644 --- a/sdext/source/presenter/PresenterFrameworkObserver.cxx +++ b/sdext/source/presenter/PresenterFrameworkObserver.cxx @@ -26,8 +26,6 @@ using namespace ::com::sun::star::drawing::framework; using ::rtl::OUString; -#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString))) - namespace sdext { namespace presenter { PresenterFrameworkObserver::PresenterFrameworkObserver ( @@ -54,7 +52,7 @@ PresenterFrameworkObserver::PresenterFrameworkObserver ( } mxConfigurationController->addConfigurationChangeListener( this, - A2S("ConfigurationUpdateEnd"), + "ConfigurationUpdateEnd", Any()); } else @@ -124,7 +122,7 @@ void SAL_CALL PresenterFrameworkObserver::notifyConfigurationChange ( Action aAction (maAction); Predicate aPredicate (maPredicate); - if (rEvent.Type.equals(A2S("ConfigurationUpdateEnd"))) + if (rEvent.Type.equals("ConfigurationUpdateEnd")) { Shutdown(); aAction(aPredicate); diff --git a/sdext/source/presenter/PresenterHelpView.cxx b/sdext/source/presenter/PresenterHelpView.cxx index d0293b24c3e7..638b72855964 100644 --- a/sdext/source/presenter/PresenterHelpView.cxx +++ b/sdext/source/presenter/PresenterHelpView.cxx @@ -40,8 +40,6 @@ using namespace ::com::sun::star::drawing::framework; using ::rtl::OUString; using ::std::vector; -#define A2S(pString) (::rtl::OUString(pString)) - namespace sdext { namespace presenter { namespace { @@ -171,7 +169,7 @@ PresenterHelpView::PresenterHelpView ( mpPresenterController->GetTheme(), mxWindow, mxCanvas, - A2S("HelpViewCloser")); + "HelpViewCloser"); ReadHelpStrings(); Resize(); @@ -363,7 +361,7 @@ void PresenterHelpView::ReadHelpStrings (void) OUString("/org.openoffice.Office.PresenterScreen/"), PresenterConfigurationAccess::READ_ONLY); Reference<container::XNameAccess> xStrings ( - aConfiguration.GetConfigurationNode(A2S("PresenterScreenSettings/HelpView/HelpStrings")), + aConfiguration.GetConfigurationNode("PresenterScreenSettings/HelpView/HelpStrings"), UNO_QUERY); PresenterConfigurationAccess::ForAll( xStrings, @@ -377,9 +375,9 @@ void PresenterHelpView::ProcessString ( return; OUString sLeftText; - PresenterConfigurationAccess::GetProperty(rsProperties, A2S("Left")) >>= sLeftText; + PresenterConfigurationAccess::GetProperty(rsProperties, "Left") >>= sLeftText; OUString sRightText; - PresenterConfigurationAccess::GetProperty(rsProperties, A2S("Right")) >>= sRightText; + PresenterConfigurationAccess::GetProperty(rsProperties, "Right") >>= sRightText; mpTextContainer->push_back( ::boost::shared_ptr<Block>( new Block(sLeftText, sRightText, mpFont->mxFont, mnMaximalWidth))); @@ -730,16 +728,16 @@ void LineDescriptorList::FormatText ( } } else if (PresenterCanvasHelper::GetTextSize( - rxFont, aLineDescriptor.msLine+A2S(", ")+*iPart).Width > nMaximalWidth) + rxFont, aLineDescriptor.msLine+", "+*iPart).Width > nMaximalWidth) { - aLineDescriptor.AddPart(A2S(","), rxFont); + aLineDescriptor.AddPart(",", rxFont); mpLineDescriptors->push_back(aLineDescriptor); aLineDescriptor = LineDescriptor(); continue; } else { - aLineDescriptor.AddPart(A2S(", ")+*iPart, rxFont); + aLineDescriptor.AddPart(", "+*iPart, rxFont); } ++iPart; } diff --git a/sdext/source/presenter/PresenterNotesView.cxx b/sdext/source/presenter/PresenterNotesView.cxx index f3dbdbe432fc..deb248f6485f 100644 --- a/sdext/source/presenter/PresenterNotesView.cxx +++ b/sdext/source/presenter/PresenterNotesView.cxx @@ -47,8 +47,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::drawing::framework; using ::rtl::OUString; -#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString))) - static const sal_Int32 gnSpaceBelowSeparator (10); static const sal_Int32 gnSpaceAboveSeparator (10); static const sal_Int32 gnPartHeight (128); @@ -111,7 +109,7 @@ PresenterNotesView::PresenterNotesView ( mpPresenterController->GetTheme(), mxParentWindow, mxCanvas, - A2S("NotesViewCloser")); + "NotesViewCloser"); if (mxParentWindow.is()) { @@ -223,15 +221,15 @@ void PresenterNotesView::CreateToolBar ( rpPresenterController, PresenterToolBar::Left); mpToolBar->Initialize( - A2S("PresenterScreenSettings/ToolBars/NotesToolBar")); + "PresenterScreenSettings/ToolBars/NotesToolBar"); } void PresenterNotesView::SetSlide (const Reference<drawing::XDrawPage>& rxNotesPage) { static const ::rtl::OUString sNotesShapeName ( - A2S("com.sun.star.presentation.NotesShape")); + "com.sun.star.presentation.NotesShape"); static const ::rtl::OUString sTextShapeName ( - A2S("com.sun.star.drawing.TextShape")); + "com.sun.star.drawing.TextShape"); Reference<container::XIndexAccess> xIndexAccess (rxNotesPage, UNO_QUERY); if (xIndexAccess.is()) @@ -660,8 +658,8 @@ void PresenterNotesView::ChangeFontSize (const sal_Int32 nSizeChange) if (pConfiguration.get()==NULL || ! pConfiguration->IsValid()) return; - pConfiguration->GoToChild(A2S("Font")); - pConfiguration->SetProperty(A2S("Size"), Any((sal_Int32)(nNewSize+0.5))); + pConfiguration->GoToChild(OUString("Font")); + pConfiguration->SetProperty("Size", Any((sal_Int32)(nNewSize+0.5))); pConfiguration->CommitChanges(); } catch (Exception&) @@ -703,7 +701,7 @@ void PresenterNotesView::ThrowIfDisposed (void) if (rBHelper.bDisposed || rBHelper.bInDispose) { throw lang::DisposedException ( - A2S("PresenterNotesView object has already been disposed"), + "PresenterNotesView object has already been disposed", static_cast<uno::XWeak*>(this)); } } diff --git a/sdext/source/presenter/PresenterPaneBorderPainter.cxx b/sdext/source/presenter/PresenterPaneBorderPainter.cxx index f683ce1da178..bcee08161b8e 100644 --- a/sdext/source/presenter/PresenterPaneBorderPainter.cxx +++ b/sdext/source/presenter/PresenterPaneBorderPainter.cxx @@ -44,8 +44,6 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using ::rtl::OUString; -#define A2S(s) (::rtl::OUString(s)) - namespace sdext { namespace presenter { namespace { @@ -842,16 +840,16 @@ RendererPaneStyle::RendererPaneStyle ( { if (rpTheme.get() != NULL) { - mpTopLeft = GetBitmap(rpTheme, rsStyleName, A2S("TopLeft")); - mpTop = GetBitmap(rpTheme, rsStyleName, A2S("Top")); - mpTopRight = GetBitmap(rpTheme, rsStyleName, A2S("TopRight")); - mpLeft = GetBitmap(rpTheme, rsStyleName, A2S("Left")); - mpRight = GetBitmap(rpTheme, rsStyleName, A2S("Right")); - mpBottomLeft = GetBitmap(rpTheme, rsStyleName, A2S("BottomLeft")); - mpBottom = GetBitmap(rpTheme, rsStyleName, A2S("Bottom")); - mpBottomRight = GetBitmap(rpTheme, rsStyleName, A2S("BottomRight")); - mpBottomCallout = GetBitmap(rpTheme, rsStyleName, A2S("BottomCallout")); - mpBackground = GetBitmap(rpTheme, OUString(), A2S("Background")); + mpTopLeft = GetBitmap(rpTheme, rsStyleName, "TopLeft"); + mpTop = GetBitmap(rpTheme, rsStyleName, "Top"); + mpTopRight = GetBitmap(rpTheme, rsStyleName, "TopRight"); + mpLeft = GetBitmap(rpTheme, rsStyleName,"Left"); + mpRight = GetBitmap(rpTheme, rsStyleName, "Right"); + mpBottomLeft = GetBitmap(rpTheme, rsStyleName, "BottomLeft"); + mpBottom = GetBitmap(rpTheme, rsStyleName, "Bottom"); + mpBottomRight = GetBitmap(rpTheme, rsStyleName, "BottomRight"); + mpBottomCallout = GetBitmap(rpTheme, rsStyleName, "BottomCallout"); + mpBackground = GetBitmap(rpTheme, OUString(), "Background"); // Get font description. mpFont = rpTheme->GetFont(rsStyleName); diff --git a/sdext/source/presenter/PresenterProtocolHandler.cxx b/sdext/source/presenter/PresenterProtocolHandler.cxx index 34da2bd17fb2..4df8067ba64f 100644 --- a/sdext/source/presenter/PresenterProtocolHandler.cxx +++ b/sdext/source/presenter/PresenterProtocolHandler.cxx @@ -42,8 +42,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::drawing::framework; using ::rtl::OUString; -#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString))) - namespace sdext { namespace presenter { namespace { @@ -243,7 +241,7 @@ OUString PresenterProtocolHandler::getImplementationName_static (void) Sequence<OUString> PresenterProtocolHandler::getSupportedServiceNames_static (void) { - static const ::rtl::OUString sServiceName(A2S("com.sun.star.frame.ProtocolHandler")); + static const ::rtl::OUString sServiceName("com.sun.star.frame.ProtocolHandler"); return Sequence<rtl::OUString>(&sServiceName, 1); } @@ -375,29 +373,29 @@ Command* PresenterProtocolHandler::Dispatch::CreateCommand ( if (rsURLPath.getLength() <= 5) return NULL; - if (rsURLPath == A2S("CloseNotes")) + if (rsURLPath == "CloseNotes") return new SetNotesViewCommand(false, rpPresenterController); - if (rsURLPath == A2S("CloseSlideSorter")) + if (rsURLPath == "CloseSlideSorter") return new SetSlideSorterCommand(false, rpPresenterController); - if (rsURLPath == A2S("CloseHelp")) + if (rsURLPath == "CloseHelp") return new SetHelpViewCommand(false, rpPresenterController); - if (rsURLPath == A2S("GrowNotesFont")) + if (rsURLPath == "GrowNotesFont") return new NotesFontSizeCommand(rpPresenterController, +1); - if (rsURLPath == A2S("NextEffect")) + if (rsURLPath == "NextEffect") return new GotoNextEffectCommand(rpPresenterController); - if (rsURLPath == A2S("NextSlide")) + if (rsURLPath == "NextSlide") return new GotoNextSlideCommand(rpPresenterController); - if (rsURLPath == A2S("PrevSlide")) + if (rsURLPath == "PrevSlide") return new GotoPreviousSlideCommand(rpPresenterController); - if (rsURLPath == A2S("SwitchMonitor")) + if (rsURLPath == "SwitchMonitor") return new SwitchMonitorCommand(rpPresenterController); - if (rsURLPath == A2S("ShowNotes")) + if (rsURLPath == "ShowNotes") return new SetNotesViewCommand(true, rpPresenterController); - if (rsURLPath == A2S("ShowSlideSorter")) + if (rsURLPath == "ShowSlideSorter") return new SetSlideSorterCommand(true, rpPresenterController); - if (rsURLPath == A2S("ShowHelp")) + if (rsURLPath == "ShowHelp") return new SetHelpViewCommand(true, rpPresenterController); - if (rsURLPath == A2S("ShrinkNotesFont")) + if (rsURLPath == "ShrinkNotesFont") return new NotesFontSizeCommand(rpPresenterController, -1); return NULL; diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx index 41133a1c0863..1ac293386d3f 100644 --- a/sdext/source/presenter/PresenterScreen.cxx +++ b/sdext/source/presenter/PresenterScreen.cxx @@ -48,8 +48,6 @@ using namespace ::com::sun::star::presentation; using namespace ::com::sun::star::drawing::framework; using ::rtl::OUString; -#define A2S(s) (::rtl::OUString(s)) - namespace sdext { namespace presenter { namespace { @@ -434,7 +432,7 @@ void PresenterScreen::SwitchMonitors() Reference<beans::XPropertySet> xProperties (xPresentation, UNO_QUERY_THROW); uno::Any aDisplay; aDisplay <<= nNewScreen; - xProperties->setPropertyValue(A2S("Display"), aDisplay); + xProperties->setPropertyValue("Display", aDisplay); } catch (const uno::Exception &) { } } @@ -456,7 +454,7 @@ sal_Int32 PresenterScreen::GetPresenterScreenNumber ( // Determine the screen on which the full screen presentation is being // displayed. sal_Int32 nDisplayNumber (-1); - if ( ! (xProperties->getPropertyValue(A2S("Display")) >>= nDisplayNumber)) + if ( ! (xProperties->getPropertyValue("Display") >>= nDisplayNumber)) return -1; if (nDisplayNumber == -1) { @@ -550,7 +548,7 @@ Reference<drawing::framework::XResourceId> PresenterScreen::GetMainPaneId ( return ResourceId::create( Reference<XComponentContext>(mxContextWeak), PresenterHelper::msFullScreenPaneURL - +A2S("?FullScreen=true&ScreenNumber=") + + "?FullScreen=true&ScreenNumber=" + OUString::valueOf(nScreen)); } @@ -714,7 +712,7 @@ void PresenterScreen::ProcessViewDescriptions ( try { Reference<container::XNameAccess> xViewDescriptionsNode ( - rConfiguration.GetConfigurationNode(A2S("Presenter/Views")), + rConfiguration.GetConfigurationNode("Presenter/Views"), UNO_QUERY_THROW); ::std::vector<rtl::OUString> aProperties (4); diff --git a/sdext/source/presenter/PresenterScrollBar.cxx b/sdext/source/presenter/PresenterScrollBar.cxx index cb87d61f4166..bed4fccbb55f 100644 --- a/sdext/source/presenter/PresenterScrollBar.cxx +++ b/sdext/source/presenter/PresenterScrollBar.cxx @@ -40,8 +40,6 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using ::rtl::OUString; -#define A2S(pString) (::rtl::OUString(pString)) - const static double gnScrollBarGap (10); namespace sdext { namespace presenter { @@ -777,14 +775,14 @@ void PresenterVerticalScrollBar::UpdateBitmaps (void) { if (mpBitmaps.get() != NULL) { - mpPrevButtonDescriptor = mpBitmaps->GetBitmap(A2S("Up")); - mpNextButtonDescriptor = mpBitmaps->GetBitmap(A2S("Down")); - mpPagerStartDescriptor = mpBitmaps->GetBitmap(A2S("PagerTop")); - mpPagerCenterDescriptor = mpBitmaps->GetBitmap(A2S("PagerVertical")); - mpPagerEndDescriptor = mpBitmaps->GetBitmap(A2S("PagerBottom")); - mpThumbStartDescriptor = mpBitmaps->GetBitmap(A2S("ThumbTop")); - mpThumbCenterDescriptor = mpBitmaps->GetBitmap(A2S("ThumbVertical")); - mpThumbEndDescriptor = mpBitmaps->GetBitmap(A2S("ThumbBottom")); + mpPrevButtonDescriptor = mpBitmaps->GetBitmap("Up"); + mpNextButtonDescriptor = mpBitmaps->GetBitmap("Down"); + mpPagerStartDescriptor = mpBitmaps->GetBitmap("PagerTop"); + mpPagerCenterDescriptor = mpBitmaps->GetBitmap("PagerVertical"); + mpPagerEndDescriptor = mpBitmaps->GetBitmap("PagerBottom"); + mpThumbStartDescriptor = mpBitmaps->GetBitmap("ThumbTop"); + mpThumbCenterDescriptor = mpBitmaps->GetBitmap("ThumbVertical"); + mpThumbEndDescriptor = mpBitmaps->GetBitmap("ThumbBottom"); mnScrollBarWidth = 0; UpdateWidthOrHeight(mnScrollBarWidth, mpPrevButtonDescriptor); diff --git a/sdext/source/presenter/PresenterSlideShowView.cxx b/sdext/source/presenter/PresenterSlideShowView.cxx index be99fa56c18e..0a7920a34b57 100644 --- a/sdext/source/presenter/PresenterSlideShowView.cxx +++ b/sdext/source/presenter/PresenterSlideShowView.cxx @@ -1,3 +1,4 @@ + /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. @@ -45,8 +46,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::drawing::framework; using ::rtl::OUString; -#define A2S(pString) (::rtl::OUString(pString)) - namespace sdext { namespace presenter { //===== PresenterSlideShowView ================================================ @@ -167,12 +166,12 @@ void PresenterSlideShowView::LateInit (void) PresenterConfigurationAccess::msPresenterScreenRootName, PresenterConfigurationAccess::READ_ONLY); aConfiguration.GetConfigurationNode( - A2S("Presenter/Views/CurrentSlidePreview/" - "Strings/ClickToExitPresentationText/String")) + "Presenter/Views/CurrentSlidePreview/" + "Strings/ClickToExitPresentationText/String") >>= msClickToExitPresentationText; aConfiguration.GetConfigurationNode( - A2S("Presenter/Views/CurrentSlidePreview/" - "Strings/ClickToExitPresentationTitle/String")) + "Presenter/Views/CurrentSlidePreview/" + "Strings/ClickToExitPresentationTitle/String") >>= msClickToExitPresentationTitle; } @@ -1006,7 +1005,7 @@ void PresenterSlideShowView::impl_addAndConfigureView() // Prevent embeded sounds being played twice at the same time by // disabling sound for the new slide show view. beans::PropertyValue aProperty; - aProperty.Name = A2S("IsSoundEnabled"); + aProperty.Name = "IsSoundEnabled"; Sequence<Any> aValues (2); aValues[0] <<= xView; aValues[1] <<= sal_False; diff --git a/sdext/source/presenter/PresenterSlideSorter.cxx b/sdext/source/presenter/PresenterSlideSorter.cxx index 414815256d3a..bdffca4327bc 100644 --- a/sdext/source/presenter/PresenterSlideSorter.cxx +++ b/sdext/source/presenter/PresenterSlideSorter.cxx @@ -49,8 +49,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::drawing::framework; using ::rtl::OUString; -#define A2S(pString) (::rtl::OUString(pString)) - namespace { const static sal_Int32 gnVerticalGap (10); const static sal_Int32 gnVerticalBorder (10); @@ -316,12 +314,12 @@ PresenterSlideSorter::PresenterSlideSorter ( mpPresenterController->GetTheme(), mxWindow, mxCanvas, - A2S("SlideSorterCloser")); + "SlideSorterCloser"); if (mpPresenterController->GetTheme().get() != NULL) { PresenterTheme::SharedFontDescriptor pFont ( - mpPresenterController->GetTheme()->GetFont(A2S("ButtonFont"))); + mpPresenterController->GetTheme()->GetFont("ButtonFont")); if (pFont.get() != NULL) maSeparatorColor = pFont->mnColor; } @@ -1433,12 +1431,12 @@ PresenterSlideSorter::MouseOverManager::MouseOverManager ( ::boost::shared_ptr<PresenterBitmapContainer> pBitmaps (rpTheme->GetBitmapContainer()); if (pBitmaps.get() != NULL) { - mpLeftLabelBitmap = pBitmaps->GetBitmap(A2S("LabelLeft")); - mpCenterLabelBitmap = pBitmaps->GetBitmap(A2S("LabelCenter")); - mpRightLabelBitmap = pBitmaps->GetBitmap(A2S("LabelRight")); + mpLeftLabelBitmap = pBitmaps->GetBitmap("LabelLeft"); + mpCenterLabelBitmap = pBitmaps->GetBitmap("LabelCenter"); + mpRightLabelBitmap = pBitmaps->GetBitmap("LabelRight"); } - mpFont = rpTheme->GetFont(A2S("SlideSorterLabelFont")); + mpFont = rpTheme->GetFont("SlideSorterLabelFont"); } } @@ -1510,10 +1508,10 @@ void PresenterSlideSorter::MouseOverManager::SetSlide ( Reference<beans::XPropertySet> xSlideProperties(mxSlides->getByIndex(nSlideIndex), UNO_QUERY); if (xSlideProperties.is()) - xSlideProperties->getPropertyValue(A2S("LinkDisplayName")) >>= msText; + xSlideProperties->getPropertyValue("LinkDisplayName") >>= msText; if (msText.isEmpty()) - msText = A2S("Slide ") + OUString::valueOf(nSlideIndex + 1); + msText = "Slide " + OUString::valueOf(nSlideIndex + 1); } } else @@ -1607,7 +1605,7 @@ OUString PresenterSlideSorter::MouseOverManager::GetFittingText ( double nBestWidth (0); OUString sBestCandidate; sal_Int32 nLength (round(rsText.getLength() * nMaximalWidth / nTextWidth)); - const OUString sEllipses (A2S("...")); + const OUString sEllipses ("..."); while (true) { const OUString sCandidate (rsText.copy(0,nLength) + sEllipses); @@ -1726,25 +1724,25 @@ PresenterSlideSorter::CurrentSlideFrameRenderer::CurrentSlideFrameRenderer ( PresenterConfigurationAccess::READ_ONLY); Reference<container::XHierarchicalNameAccess> xBitmaps ( aConfiguration.GetConfigurationNode( - A2S("PresenterScreenSettings/SlideSorter/CurrentSlideBorderBitmaps")), + "PresenterScreenSettings/SlideSorter/CurrentSlideBorderBitmaps"), UNO_QUERY); if ( ! xBitmaps.is()) return; PresenterBitmapContainer aContainer ( - A2S("PresenterScreenSettings/SlideSorter/CurrentSlideBorderBitmaps"), + "PresenterScreenSettings/SlideSorter/CurrentSlideBorderBitmaps", ::boost::shared_ptr<PresenterBitmapContainer>(), rxContext, rxCanvas); - mpTopLeft = aContainer.GetBitmap(A2S("TopLeft")); - mpTop = aContainer.GetBitmap(A2S("Top")); - mpTopRight = aContainer.GetBitmap(A2S("TopRight")); - mpLeft = aContainer.GetBitmap(A2S("Left")); - mpRight = aContainer.GetBitmap(A2S("Right")); - mpBottomLeft = aContainer.GetBitmap(A2S("BottomLeft")); - mpBottom = aContainer.GetBitmap(A2S("Bottom")); - mpBottomRight = aContainer.GetBitmap(A2S("BottomRight")); + mpTopLeft = aContainer.GetBitmap("TopLeft"); + mpTop = aContainer.GetBitmap("Top"); + mpTopRight = aContainer.GetBitmap("TopRight"); + mpLeft = aContainer.GetBitmap("Left"); + mpRight = aContainer.GetBitmap("Right"); + mpBottomLeft = aContainer.GetBitmap("BottomLeft"); + mpBottom = aContainer.GetBitmap("Bottom"); + mpBottomRight = aContainer.GetBitmap("BottomRight"); // Determine size of frame. if (mpTop.get() != NULL) diff --git a/sdext/source/presenter/PresenterTextView.cxx b/sdext/source/presenter/PresenterTextView.cxx index 6599f4fbfa81..f06169c93625 100644 --- a/sdext/source/presenter/PresenterTextView.cxx +++ b/sdext/source/presenter/PresenterTextView.cxx @@ -41,8 +41,6 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::accessibility; using namespace ::com::sun::star::uno; -#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString))) - const static sal_Int64 CaretBlinkIntervall = 500 * 1000 * 1000; //#define SHOW_CHARACTER_BOXES @@ -97,7 +95,7 @@ PresenterTextView::PresenterTextView ( // portions of the same text direction. mxScriptTypeDetector = Reference<i18n::XScriptTypeDetector>( xFactory->createInstanceWithContext( - A2S("com.sun.star.i18n.ScriptTypeDetector"), + "com.sun.star.i18n.ScriptTypeDetector", rxContext), UNO_QUERY_THROW); } @@ -487,7 +485,7 @@ PresenterTextParagraph::PresenterTextParagraph ( lang::Locale aLocale; try { - xProperties->getPropertyValue(A2S("CharLocale")) >>= aLocale; + xProperties->getPropertyValue("CharLocale") >>= aLocale; } catch(beans::UnknownPropertyException&) { @@ -495,7 +493,7 @@ PresenterTextParagraph::PresenterTextParagraph ( } try { - xProperties->getPropertyValue(A2S("ParaAdjust")) >>= meAdjust; + xProperties->getPropertyValue("ParaAdjust") >>= meAdjust; } catch(beans::UnknownPropertyException&) { @@ -503,7 +501,7 @@ PresenterTextParagraph::PresenterTextParagraph ( } try { - xProperties->getPropertyValue(A2S("WritingMode")) >>= mnWritingMode; + xProperties->getPropertyValue("WritingMode") >>= mnWritingMode; } catch(beans::UnknownPropertyException&) { diff --git a/sdext/source/presenter/PresenterTheme.cxx b/sdext/source/presenter/PresenterTheme.cxx index 5decc57dfd50..58ee37b4ecb9 100644 --- a/sdext/source/presenter/PresenterTheme.cxx +++ b/sdext/source/presenter/PresenterTheme.cxx @@ -38,8 +38,6 @@ using namespace ::com::sun::star::uno; using namespace ::std; using ::rtl::OUString; -#define A2S(s) (::rtl::OUString(s)) - namespace sdext { namespace presenter { namespace { @@ -388,7 +386,7 @@ bool PresenterTheme::ConvertToColor ( pConfiguration->GoToChild( ::boost::bind(&PresenterConfigurationAccess::IsStringPropertyEqual, rsStyleName, - A2S("StyleName"), + OUString::createFromAscii("StyleName"), _2)); } return pConfiguration; @@ -402,7 +400,7 @@ SharedBitmapDescriptor PresenterTheme::GetBitmap ( { if (rsStyleName.isEmpty()) { - if (rsBitmapName == A2S("Background")) + if (rsBitmapName == "Background") { ::boost::shared_ptr<Theme> pTheme (mpTheme); while (pTheme.get()!=NULL && pTheme->mpBackground.get()==NULL) @@ -441,7 +439,7 @@ SharedBitmapDescriptor PresenterTheme::GetBitmap ( { if (mpTheme.get() != NULL) { - if (rsBitmapName == A2S("Background")) + if (rsBitmapName == "Background") { ::boost::shared_ptr<Theme> pTheme (mpTheme); while (pTheme.get()!=NULL && pTheme->mpBackground.get()==NULL) @@ -542,13 +540,13 @@ Reference<rendering::XCanvasFont> PresenterTheme::FontDescriptor::CreateFont ( rendering::FontRequest aFontRequest; aFontRequest.FontDescription.FamilyName = msFamilyName; if (msFamilyName.isEmpty()) - aFontRequest.FontDescription.FamilyName = A2S("Tahoma"); + aFontRequest.FontDescription.FamilyName = "Tahoma"; aFontRequest.FontDescription.StyleName = msStyleName; aFontRequest.CellSize = nCellSize; // Make an attempt at translating the style name(s)into a corresponding // font description. - if (msStyleName == A2S("Bold")) + if (msStyleName == "Bold") aFontRequest.FontDescription.FontDescription.Weight = rendering::PanoseWeight::HEAVY; return rxCanvas->createFont( @@ -576,7 +574,7 @@ double PresenterTheme::FontDescriptor::GetCellSizeForDesignSize ( if ( ! xFont.is()) return nDesignSize; - geometry::RealRectangle2D aBox (PresenterCanvasHelper::GetTextBoundingBox (xFont, A2S("X"))); + geometry::RealRectangle2D aBox (PresenterCanvasHelper::GetTextBoundingBox (xFont, "X")); const double nAscent (-aBox.Y1); const double nDescent (aBox.Y2); @@ -609,12 +607,12 @@ void PresenterTheme::Theme::Read ( PresenterConfigurationAccess& rConfiguration, ReadContext& rReadContext) { - PresenterConfigurationAccess::GetConfigurationNode(mxThemeRoot, A2S("ThemeName")) + PresenterConfigurationAccess::GetConfigurationNode(mxThemeRoot, "ThemeName") >>= msThemeName; // Parent theme name. OUString sParentThemeName; - if ((PresenterConfigurationAccess::GetConfigurationNode(mxThemeRoot, A2S("ParentTheme")) + if ((PresenterConfigurationAccess::GetConfigurationNode(mxThemeRoot, "ParentTheme") >>= sParentThemeName) && !sParentThemeName.isEmpty()) { @@ -624,7 +622,7 @@ void PresenterTheme::Theme::Read ( // Background. mpBackground = PresenterBitmapContainer::LoadBitmap( mxThemeRoot, - A2S("Background"), + "Background", rReadContext.mxPresenterHelper, rReadContext.mxCanvas, SharedBitmapDescriptor()); @@ -642,7 +640,7 @@ void PresenterTheme::Theme::Read ( mpIconContainer.reset( new PresenterBitmapContainer( Reference<container::XNameAccess>( - PresenterConfigurationAccess::GetConfigurationNode(mxThemeRoot, A2S("Bitmaps")), + PresenterConfigurationAccess::GetConfigurationNode(mxThemeRoot, "Bitmaps"), UNO_QUERY), mpParentTheme.get()!=NULL ? mpParentTheme->mpIconContainer @@ -652,7 +650,7 @@ void PresenterTheme::Theme::Read ( // Read fonts. Reference<container::XNameAccess> xFontNode( - PresenterConfigurationAccess::GetConfigurationNode(mxThemeRoot, A2S("Fonts")), + PresenterConfigurationAccess::GetConfigurationNode(mxThemeRoot, "Fonts"), UNO_QUERY); PresenterConfigurationAccess::ForAll( xFontNode, @@ -751,15 +749,15 @@ PresenterTheme::SharedFontDescriptor ReadContext::ReadFont ( ::boost::shared_ptr<PresenterTheme::FontDescriptor> pDescriptor ( new PresenterTheme::FontDescriptor(rpDefault)); - PresenterConfigurationAccess::GetProperty(rxProperties, A2S("FamilyName")) >>= pDescriptor->msFamilyName; - PresenterConfigurationAccess::GetProperty(rxProperties, A2S("Style")) >>= pDescriptor->msStyleName; - PresenterConfigurationAccess::GetProperty(rxProperties, A2S("Size")) >>= pDescriptor->mnSize; + PresenterConfigurationAccess::GetProperty(rxProperties, "FamilyName") >>= pDescriptor->msFamilyName; + PresenterConfigurationAccess::GetProperty(rxProperties, "Style") >>= pDescriptor->msStyleName; + PresenterConfigurationAccess::GetProperty(rxProperties, "Size") >>= pDescriptor->mnSize; PresenterTheme::ConvertToColor( - PresenterConfigurationAccess::GetProperty(rxProperties, A2S("Color")), + PresenterConfigurationAccess::GetProperty(rxProperties, "Color"), pDescriptor->mnColor); - PresenterConfigurationAccess::GetProperty(rxProperties, A2S("Anchor")) >>= pDescriptor->msAnchor; - PresenterConfigurationAccess::GetProperty(rxProperties, A2S("XOffset")) >>= pDescriptor->mnXOffset; - PresenterConfigurationAccess::GetProperty(rxProperties, A2S("YOffset")) >>= pDescriptor->mnYOffset; + PresenterConfigurationAccess::GetProperty(rxProperties, "Anchor") >>= pDescriptor->msAnchor; + PresenterConfigurationAccess::GetProperty(rxProperties, "XOffset") >>= pDescriptor->mnXOffset; + PresenterConfigurationAccess::GetProperty(rxProperties, "YOffset") >>= pDescriptor->mnYOffset; return pDescriptor; } @@ -785,16 +783,16 @@ Any ReadContext::GetByName ( if (sCurrentThemeName.isEmpty()) { // No theme name given. Look up the CurrentTheme property. - rConfiguration.GetConfigurationNode(A2S("Presenter/CurrentTheme")) >>= sCurrentThemeName; + rConfiguration.GetConfigurationNode("Presenter/CurrentTheme") >>= sCurrentThemeName; if (sCurrentThemeName.isEmpty()) { // Still no name. Use "DefaultTheme". - sCurrentThemeName = A2S("DefaultTheme"); + sCurrentThemeName = "DefaultTheme"; } } Reference<container::XNameAccess> xThemes ( - rConfiguration.GetConfigurationNode(A2S("Presenter/Themes")), + rConfiguration.GetConfigurationNode("Presenter/Themes"), UNO_QUERY); if (xThemes.is()) { @@ -808,7 +806,7 @@ Any ReadContext::GetByName ( if (xTheme.is()) { OUString sThemeName; - PresenterConfigurationAccess::GetConfigurationNode(xTheme, A2S("ThemeName")) + PresenterConfigurationAccess::GetConfigurationNode(xTheme, "ThemeName") >>= sThemeName; if (sThemeName == sCurrentThemeName) { @@ -833,10 +831,10 @@ BorderSize ReadContext::ReadBorderSize (const Reference<container::XNameAccess>& if (rxNode.is()) { - GetByName(rxNode, A2S("Left")) >>= aBorderSize.mnLeft; - GetByName(rxNode, A2S("Top")) >>= aBorderSize.mnTop; - GetByName(rxNode, A2S("Right")) >>= aBorderSize.mnRight; - GetByName(rxNode, A2S("Bottom")) >>= aBorderSize.mnBottom; + GetByName(rxNode, "Left") >>= aBorderSize.mnLeft; + GetByName(rxNode, "Top") >>= aBorderSize.mnTop; + GetByName(rxNode, "Right") >>= aBorderSize.mnRight; + GetByName(rxNode, "Bottom") >>= aBorderSize.mnBottom; } return aBorderSize; @@ -851,18 +849,18 @@ void PaneStyleContainer::Read ( Reference<container::XNameAccess> xPaneStyleList ( PresenterConfigurationAccess::GetConfigurationNode( rxThemeRoot, - A2S("PaneStyles")), + "PaneStyles"), UNO_QUERY); if (xPaneStyleList.is()) { ::std::vector<rtl::OUString> aProperties; aProperties.reserve(6); - aProperties.push_back(A2S("StyleName")); - aProperties.push_back(A2S("ParentStyle")); - aProperties.push_back(A2S("TitleFont")); - aProperties.push_back(A2S("InnerBorderSize")); - aProperties.push_back(A2S("OuterBorderSize")); - aProperties.push_back(A2S("BorderBitmapList")); + aProperties.push_back("StyleName"); + aProperties.push_back("ParentStyle"); + aProperties.push_back("TitleFont"); + aProperties.push_back("InnerBorderSize"); + aProperties.push_back("OuterBorderSize"); + aProperties.push_back("BorderBitmapList"); PresenterConfigurationAccess::ForAll( xPaneStyleList, aProperties, @@ -900,7 +898,7 @@ void PaneStyleContainer::ProcessPaneStyle( Reference<container::XHierarchicalNameAccess> xFontNode (rValues[2], UNO_QUERY); pStyle->mpFont = rReadContext.ReadFont( - xFontNode, A2S(""), PresenterTheme::SharedFontDescriptor()); + xFontNode, "", PresenterTheme::SharedFontDescriptor()); Reference<container::XNameAccess> xInnerBorderSizeNode (rValues[3], UNO_QUERY); pStyle->maInnerBorderSize = rReadContext.ReadBorderSize(xInnerBorderSizeNode); @@ -1006,7 +1004,7 @@ void ViewStyleContainer::Read ( Reference<container::XNameAccess> xViewStyleList ( PresenterConfigurationAccess::GetConfigurationNode( rxThemeRoot, - A2S("ViewStyles")), + "ViewStyles"), UNO_QUERY); if (xViewStyleList.is()) { @@ -1023,11 +1021,11 @@ void ViewStyleContainer::ProcessViewStyle( { ::boost::shared_ptr<ViewStyle> pStyle (new ViewStyle()); - PresenterConfigurationAccess::GetProperty(rxProperties, A2S("StyleName")) + PresenterConfigurationAccess::GetProperty(rxProperties, "StyleName") >>= pStyle->msStyleName; OUString sParentStyleName; - if (PresenterConfigurationAccess::GetProperty(rxProperties, A2S("ParentStyle")) + if (PresenterConfigurationAccess::GetProperty(rxProperties, "ParentStyle") >>= sParentStyleName) { // Find parent style. @@ -1044,14 +1042,14 @@ void ViewStyleContainer::ProcessViewStyle( const OUString sPathToFont; // empty string Reference<container::XHierarchicalNameAccess> xFontNode ( - PresenterConfigurationAccess::GetProperty(rxProperties, A2S("Font")), UNO_QUERY); + PresenterConfigurationAccess::GetProperty(rxProperties, "Font"), UNO_QUERY); PresenterTheme::SharedFontDescriptor pFont ( rReadContext.ReadFont(xFontNode, sPathToFont, PresenterTheme::SharedFontDescriptor())); if (pFont.get() != NULL) pStyle->mpFont = pFont; Reference<container::XHierarchicalNameAccess> xBackgroundNode ( - PresenterConfigurationAccess::GetProperty(rxProperties, A2S("Background")), + PresenterConfigurationAccess::GetProperty(rxProperties, "Background"), UNO_QUERY); SharedBitmapDescriptor pBackground (PresenterBitmapContainer::LoadBitmap( xBackgroundNode, @@ -1090,7 +1088,7 @@ ViewStyle::~ViewStyle (void) const SharedBitmapDescriptor ViewStyle::GetBitmap (const OUString& rsBitmapName) const { - if (rsBitmapName == A2S("Background")) + if (rsBitmapName == "Background") return mpBackground; else return SharedBitmapDescriptor(); @@ -1115,13 +1113,13 @@ void StyleAssociationContainer::Read ( Reference<container::XNameAccess> xStyleAssociationList ( PresenterConfigurationAccess::GetConfigurationNode( rxThemeRoot, - A2S("StyleAssociations")), + "StyleAssociations"), UNO_QUERY); if (xStyleAssociationList.is()) { ::std::vector<rtl::OUString> aProperties (2); - aProperties[0] = A2S("ResourceURL"); - aProperties[1] = A2S("StyleName"); + aProperties[0] = "ResourceURL"; + aProperties[1] = "StyleName"; PresenterConfigurationAccess::ForAll( xStyleAssociationList, aProperties, diff --git a/sdext/source/presenter/PresenterTimer.cxx b/sdext/source/presenter/PresenterTimer.cxx index 41d896237732..e27d05539266 100644 --- a/sdext/source/presenter/PresenterTimer.cxx +++ b/sdext/source/presenter/PresenterTimer.cxx @@ -29,8 +29,6 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString))) - namespace sdext { namespace presenter { namespace { @@ -388,7 +386,7 @@ PresenterClockTimer::PresenterClockTimer (const Reference<XComponentContext>& rx if (xFactory.is()) mxRequestCallback = Reference<awt::XRequestCallback>( xFactory->createInstanceWithContext( - A2S("com.sun.star.awt.AsyncCallback"), + "com.sun.star.awt.AsyncCallback", rxContext), UNO_QUERY_THROW); } diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx index 34dfb7e0b01c..76aaa7ca4fec 100644 --- a/sdext/source/presenter/PresenterToolBar.cxx +++ b/sdext/source/presenter/PresenterToolBar.cxx @@ -58,8 +58,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::drawing::framework; using ::rtl::OUString; -#define A2S(pString) (::rtl::OUString(pString)) - namespace sdext { namespace presenter { static const sal_Int32 gnGapSize (20); @@ -644,7 +642,7 @@ void PresenterToolBar::CreateControls ( if (xToolBarNode.is()) { Reference<container::XNameAccess> xEntries ( - PresenterConfigurationAccess::GetConfigurationNode(xToolBarNode, A2S("Entries")), + PresenterConfigurationAccess::GetConfigurationNode(xToolBarNode, "Entries"), UNO_QUERY); Context aContext; aContext.mxPresenterHelper = mpPresenterController->GetPresenterHelper(); @@ -669,21 +667,21 @@ void PresenterToolBar::ProcessEntry ( // Type has to be present. OUString sType; - if ( ! (PresenterConfigurationAccess::GetProperty(rxProperties, A2S("Type")) >>= sType)) + if ( ! (PresenterConfigurationAccess::GetProperty(rxProperties, "Type") >>= sType)) return; OUString sName; - PresenterConfigurationAccess::GetProperty(rxProperties, A2S("Name")) >>= sName; + PresenterConfigurationAccess::GetProperty(rxProperties, "Name") >>= sName; // Read mode specific values. SharedElementMode pNormalMode (new ElementMode()); SharedElementMode pMouseOverMode (new ElementMode()); SharedElementMode pSelectedMode (new ElementMode()); SharedElementMode pDisabledMode (new ElementMode()); - pNormalMode->ReadElementMode(rxProperties, A2S("Normal"), pNormalMode, rContext); - pMouseOverMode->ReadElementMode(rxProperties, A2S("MouseOver"), pNormalMode, rContext); - pSelectedMode->ReadElementMode(rxProperties, A2S("Selected"), pNormalMode, rContext); - pDisabledMode->ReadElementMode(rxProperties, A2S("Disabled"), pNormalMode, rContext); + pNormalMode->ReadElementMode(rxProperties, "Normal", pNormalMode, rContext); + pMouseOverMode->ReadElementMode(rxProperties, "MouseOver", pNormalMode, rContext); + pSelectedMode->ReadElementMode(rxProperties, "Selected", pNormalMode, rContext); + pDisabledMode->ReadElementMode(rxProperties, "Disabled", pNormalMode, rContext); // Create new element. ::rtl::Reference<Element> pElement; @@ -1093,7 +1091,7 @@ PresenterToolBarView::PresenterToolBarView ( mxCanvas, rpPresenterController, PresenterToolBar::Center); - mpToolBar->Initialize(A2S("PresenterScreenSettings/ToolBars/ToolBar")); + mpToolBar->Initialize("PresenterScreenSettings/ToolBars/ToolBar"); if (mxWindow.is()) { @@ -1439,18 +1437,18 @@ void ElementMode::ReadElementMode ( } // Read action. - if ( ! (PresenterConfigurationAccess::GetProperty(xProperties, A2S("Action")) >>= msAction)) + if ( ! (PresenterConfigurationAccess::GetProperty(xProperties, "Action") >>= msAction)) if (rpDefaultMode.get()!=NULL) msAction = rpDefaultMode->msAction; // Read text and font OUString sText (rpDefaultMode.get()!=NULL ? rpDefaultMode->maText.GetText() : OUString()); - PresenterConfigurationAccess::GetProperty(xProperties, A2S("Text")) >>= sText; + PresenterConfigurationAccess::GetProperty(xProperties, "Text") >>= sText; Reference<container::XHierarchicalNameAccess> xFontNode ( - PresenterConfigurationAccess::GetProperty(xProperties, A2S("Font")), UNO_QUERY); + PresenterConfigurationAccess::GetProperty(xProperties, "Font"), UNO_QUERY); PresenterTheme::SharedFontDescriptor pFont (PresenterTheme::ReadFont( xFontNode, - A2S(""), + "", rpDefaultMode.get()!=NULL ? rpDefaultMode->maText.GetFont() : PresenterTheme::SharedFontDescriptor())); @@ -1458,10 +1456,10 @@ void ElementMode::ReadElementMode ( // Read bitmaps to display as icons. Reference<container::XHierarchicalNameAccess> xIconNode ( - PresenterConfigurationAccess::GetProperty(xProperties, A2S("Icon")), UNO_QUERY); + PresenterConfigurationAccess::GetProperty(xProperties, "Icon"), UNO_QUERY); mpIcon = PresenterBitmapContainer::LoadBitmap( xIconNode, - A2S(""), + "", rContext.mxPresenterHelper, rContext.mxCanvas, rpDefaultMode.get()!=NULL ? rpDefaultMode->mpIcon : SharedBitmapDescriptor()); @@ -1820,29 +1818,29 @@ OUString TimeFormatter::FormatTime (const oslDateTime& rTime) sText.append(OUString::valueOf( sal::static_int_cast<sal_Int32>(nHours>12 ? nHours-12 : nHours))); - sText.append(A2S(":")); + sText.append(":"); // Minutes const OUString sMinutes (OUString::valueOf(nMinutes)); if (sMinutes.getLength() == 1) - sText.append(A2S("0")); + sText.append("0"); sText.append(sMinutes); // Seconds if (mbIsShowSeconds) { - sText.append(A2S(":")); + sText.append(":"); const OUString sSeconds (OUString::valueOf(nSeconds)); if (sSeconds.getLength() == 1) - sText.append(A2S("0")); + sText.append("0"); sText.append(sSeconds); } if (mbIsAmPmFormat) { if (rTime.Hours < 12) - sText.append(A2S("am")); + sText.append("am"); else - sText.append(A2S("pm")); + sText.append("pm"); } return sText.makeStringAndClear(); } diff --git a/sdext/source/presenter/PresenterViewFactory.cxx b/sdext/source/presenter/PresenterViewFactory.cxx index fd5d341a5d82..bb5ec1aa5bcb 100644 --- a/sdext/source/presenter/PresenterViewFactory.cxx +++ b/sdext/source/presenter/PresenterViewFactory.cxx @@ -43,22 +43,20 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::drawing::framework; using ::rtl::OUString; -#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString))) - namespace sdext { namespace presenter { const ::rtl::OUString PresenterViewFactory::msCurrentSlidePreviewViewURL( - A2S("private:resource/view/Presenter/CurrentSlidePreview")); + "private:resource/view/Presenter/CurrentSlidePreview"); const ::rtl::OUString PresenterViewFactory::msNextSlidePreviewViewURL( - A2S("private:resource/view/Presenter/NextSlidePreview")); + "private:resource/view/Presenter/NextSlidePreview"); const ::rtl::OUString PresenterViewFactory::msNotesViewURL( - A2S("private:resource/view/Presenter/Notes")); + "private:resource/view/Presenter/Notes"); const ::rtl::OUString PresenterViewFactory::msToolBarViewURL( - A2S("private:resource/view/Presenter/ToolBar")); + "private:resource/view/Presenter/ToolBar"); const ::rtl::OUString PresenterViewFactory::msSlideSorterURL( - A2S("private:resource/view/Presenter/SlideSorter")); + "private:resource/view/Presenter/SlideSorter"); const ::rtl::OUString PresenterViewFactory::msHelpViewURL( - A2S("private:resource/view/Presenter/Help")); + "private:resource/view/Presenter/Help"); //===== SimpleView ============================================================ diff --git a/sdext/source/presenter/PresenterWindowManager.cxx b/sdext/source/presenter/PresenterWindowManager.cxx index 9f1e8d074318..c195c5b4bc44 100644 --- a/sdext/source/presenter/PresenterWindowManager.cxx +++ b/sdext/source/presenter/PresenterWindowManager.cxx @@ -58,8 +58,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::drawing::framework; using ::rtl::OUString; -#define A2S(pString) (::rtl::OUString(pString)) - namespace sdext { namespace presenter { //===== PresenterWindowManager ================================================ @@ -167,7 +165,7 @@ void PresenterWindowManager::SetTheme (const ::boost::shared_ptr<PresenterTheme> if (mpTheme.get() != NULL) { - mpBackgroundBitmap = mpTheme->GetBitmap(OUString(), A2S("Background")); + mpBackgroundBitmap = mpTheme->GetBitmap(OUString(), "Background"); } } @@ -536,7 +534,7 @@ void PresenterWindowManager::RestoreViewMode (void) mxComponentContext, OUString("/org.openoffice.Office.PresenterScreen/"), PresenterConfigurationAccess::READ_ONLY); - aConfiguration.GetConfigurationNode(A2S("Presenter/InitialViewMode")) >>= nMode; + aConfiguration.GetConfigurationNode("Presenter/InitialViewMode") >>= nMode; switch (nMode) { default: @@ -562,7 +560,7 @@ void PresenterWindowManager::StoreViewMode (const ViewMode eViewMode) mxComponentContext, OUString("/org.openoffice.Office.PresenterScreen/"), PresenterConfigurationAccess::READ_WRITE); - aConfiguration.GoToChild(A2S("Presenter")); + aConfiguration.GoToChild(OUString("Presenter")); Any aValue; switch (eViewMode) { @@ -580,7 +578,7 @@ void PresenterWindowManager::StoreViewMode (const ViewMode eViewMode) break; } - aConfiguration.SetProperty (A2S("InitialViewMode"), aValue); + aConfiguration.SetProperty ("InitialViewMode", aValue); aConfiguration.CommitChanges(); } catch (Exception&) |