summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJosé Guilherme Vanz <vanz@libreoffice.org>2013-10-20 01:43:00 -0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-10-20 12:25:45 +0000
commit288f0029c69ab0532165877637a146f774d5e740 (patch)
treebbe152c9f188fc17a75613bb10c00b1ba4c75055 /sw
parent63f705643ee92421a8bc689fb33190340d8ece6a (diff)
fdo#52622 - Reduce copy and paste code
This commit removes copy and paste code, creating a constructor for it Change-Id: I7a66cfda7fc7c11308d155a7a890352fdacfaacc Reviewed-on: https://gerrit.libreoffice.org/6356 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/lingu/olmenu.cxx22
1 files changed, 3 insertions, 19 deletions
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index 45378966c308..4e8cfd5da4de 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -228,22 +228,6 @@ void SwSpellPopup::fillLangPopupMenu(
pPopupMenu->InsertItem( nLangItemIdStart + MN_MORE_OFFSET, OUString(SW_RES( STR_LANGSTATUS_MORE )), 0 );
}
-
-static Image lcl_GetImageFromPngUrl( const OUString &rFileUrl )
-{
- Image aRes;
- OUString aTmp;
- osl::FileBase::getSystemPathFromFileURL( rFileUrl, aTmp );
- Graphic aGraphic;
- const OUString aFilterName( IMP_PNG );
- if( GRFILTER_OK == GraphicFilter::LoadGraphic( aTmp, aFilterName, aGraphic ) )
- {
- aRes = Image( aGraphic.GetBitmapEx() );
- }
- return aRes;
-}
-
-
OUString RetrieveLabelFromCommand( const OUString& aCmdURL )
{
OUString aLabel;
@@ -322,7 +306,7 @@ SwSpellPopup::SwSpellPopup(
if (xNamed.is())
{
aSuggestionImageUrl = aCfg.GetSpellAndGrammarContextSuggestionImage( xNamed->getName() );
- aImage = Image( lcl_GetImageFromPngUrl( aSuggestionImageUrl ) );
+ aImage = Image( aSuggestionImageUrl );
}
}
@@ -416,7 +400,7 @@ SwSpellPopup::SwSpellPopup(
xSvcInfo->getImplementationName() ) );
if (!aDictionaryImageUrl.isEmpty())
{
- Image aImage( lcl_GetImageFromPngUrl( aDictionaryImageUrl ) );
+ Image aImage( aDictionaryImageUrl );
pMenu->SetItemImage( nItemId, aImage );
}
}
@@ -537,7 +521,7 @@ aInfo16( SW_RES(IMG_INFO_16) )
if (xInfo.is())
{
aSuggestionImageUrl = SvtLinguConfig().GetSpellAndGrammarContextSuggestionImage( xInfo->getImplementationName() );
- aImage = Image( lcl_GetImageFromPngUrl( aSuggestionImageUrl ) );
+ aImage = Image( aSuggestionImageUrl );
}
}