summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-02-07 15:32:07 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-02-07 18:43:30 +0100
commit2b04d0a17f74a5e8b2f81521710ee91d4daa267f (patch)
tree4d8bedfc45bf8ec1ca80596b0213a72a816c4998 /accessibility
parent115457292ff792b151994303e8bbbb2b9c98bd72 (diff)
Avoid unnecessary heap allocation
Change-Id: I7bc1a0960cc100c51b90c50838a5ef620f3c763f
Diffstat (limited to 'accessibility')
-rw-r--r--accessibility/source/standard/vclxaccessiblemenuitem.cxx10
-rw-r--r--accessibility/source/standard/vclxaccessiblestatusbaritem.cxx7
-rw-r--r--accessibility/source/standard/vclxaccessibletabpage.cxx7
-rw-r--r--accessibility/source/standard/vclxaccessibletextcomponent.cxx6
4 files changed, 8 insertions, 22 deletions
diff --git a/accessibility/source/standard/vclxaccessiblemenuitem.cxx b/accessibility/source/standard/vclxaccessiblemenuitem.cxx
index a8f76edb4f3f..cc426a9d6561 100644
--- a/accessibility/source/standard/vclxaccessiblemenuitem.cxx
+++ b/accessibility/source/standard/vclxaccessiblemenuitem.cxx
@@ -36,9 +36,6 @@
#include <vcl/menu.hxx>
#include <vcl/unohelp2.hxx>
-#include <memory>
-
-
using namespace ::com::sun::star::accessibility;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
@@ -239,7 +236,6 @@ Sequence< PropertyValue > VCLXAccessibleMenuItem::getCharacterAttributes( sal_In
{
OExternalLockGuard aGuard( this );
- Sequence< PropertyValue > aValues;
OUString sText( implGetText() );
if ( !implIsValidIndex( nIndex, sText.getLength() ) )
@@ -248,10 +244,8 @@ Sequence< PropertyValue > VCLXAccessibleMenuItem::getCharacterAttributes( sal_In
Font aFont = Application::GetSettings().GetStyleSettings().GetMenuFont();
sal_Int32 nBackColor = getBackground();
sal_Int32 nColor = getForeground();
- ::std::auto_ptr< CharacterAttributesHelper > pHelper( new CharacterAttributesHelper( aFont, nBackColor, nColor ) );
- aValues = pHelper->GetCharacterAttributes( aRequestedAttributes );
-
- return aValues;
+ return CharacterAttributesHelper( aFont, nBackColor, nColor )
+ .GetCharacterAttributes( aRequestedAttributes );
}
// -----------------------------------------------------------------------------
diff --git a/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx b/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx
index f026fb5bc427..dbf5d300d627 100644
--- a/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx
+++ b/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx
@@ -35,9 +35,6 @@
#include <vcl/status.hxx>
#include <vcl/controllayout.hxx>
-#include <memory>
-
-
using namespace ::com::sun::star::accessibility;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
@@ -516,8 +513,8 @@ Sequence< PropertyValue > VCLXAccessibleStatusBarItem::getCharacterAttributes( s
Font aFont = m_pStatusBar->GetFont();
sal_Int32 nBackColor = getBackground();
sal_Int32 nColor = getForeground();
- ::std::auto_ptr< CharacterAttributesHelper > pHelper( new CharacterAttributesHelper( aFont, nBackColor, nColor ) );
- aValues = pHelper->GetCharacterAttributes( aRequestedAttributes );
+ aValues = CharacterAttributesHelper( aFont, nBackColor, nColor )
+ .GetCharacterAttributes( aRequestedAttributes );
}
return aValues;
diff --git a/accessibility/source/standard/vclxaccessibletabpage.cxx b/accessibility/source/standard/vclxaccessibletabpage.cxx
index 67a4c876415c..f4a5e138051e 100644
--- a/accessibility/source/standard/vclxaccessibletabpage.cxx
+++ b/accessibility/source/standard/vclxaccessibletabpage.cxx
@@ -35,9 +35,6 @@
#include <vcl/tabctrl.hxx>
#include <vcl/tabpage.hxx>
-#include <memory>
-
-
using namespace ::com::sun::star::accessibility;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
@@ -590,8 +587,8 @@ Sequence< PropertyValue > VCLXAccessibleTabPage::getCharacterAttributes( sal_Int
Font aFont = m_pTabControl->GetFont();
sal_Int32 nBackColor = getBackground();
sal_Int32 nColor = getForeground();
- ::std::auto_ptr< CharacterAttributesHelper > pHelper( new CharacterAttributesHelper( aFont, nBackColor, nColor ) );
- aValues = pHelper->GetCharacterAttributes( aRequestedAttributes );
+ aValues = CharacterAttributesHelper( aFont, nBackColor, nColor )
+ .GetCharacterAttributes( aRequestedAttributes );
}
return aValues;
diff --git a/accessibility/source/standard/vclxaccessibletextcomponent.cxx b/accessibility/source/standard/vclxaccessibletextcomponent.cxx
index aa43522af607..d0002ab51ebf 100644
--- a/accessibility/source/standard/vclxaccessibletextcomponent.cxx
+++ b/accessibility/source/standard/vclxaccessibletextcomponent.cxx
@@ -32,7 +32,6 @@
#include <vcl/unohelp2.hxx>
#include <vcl/ctrl.hxx>
-#include <memory>
#include <vector>
using namespace ::com::sun::star;
@@ -237,9 +236,8 @@ Sequence< PropertyValue > VCLXAccessibleTextComponent::getCharacterAttributes( s
}
*/
- ::std::auto_ptr< CharacterAttributesHelper > pHelper( new CharacterAttributesHelper( aFont, nBackColor, nColor ) );
-
- aValues = pHelper->GetCharacterAttributes( aRequestedAttributes );
+ aValues = CharacterAttributesHelper( aFont, nBackColor, nColor )
+ .GetCharacterAttributes( aRequestedAttributes );
}
return aValues;