diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2003-05-26 08:05:24 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2003-05-26 08:05:24 +0000 |
commit | 2570d86cf71a556c275fb55c29038d455f52068a (patch) | |
tree | f19a17cdc9adf6bc58a603a30518aca12bafc3bc /svx/source/accessibility/DescriptionGenerator.cxx | |
parent | 6fccc66146b089fa625a2510dda37e7dae5beda3 (diff) |
INTEGRATION: CWS draw12 (1.5.230); FILE MERGED
2003/05/16 14:55:17 af 1.5.230.1: #109147# Moved color look up into new class DGColorNameLookUp.
Diffstat (limited to 'svx/source/accessibility/DescriptionGenerator.cxx')
-rw-r--r-- | svx/source/accessibility/DescriptionGenerator.cxx | 47 |
1 files changed, 4 insertions, 43 deletions
diff --git a/svx/source/accessibility/DescriptionGenerator.cxx b/svx/source/accessibility/DescriptionGenerator.cxx index 4ebb2c2832ea..59f9cb6fdfef 100644 --- a/svx/source/accessibility/DescriptionGenerator.cxx +++ b/svx/source/accessibility/DescriptionGenerator.cxx @@ -2,9 +2,9 @@ * * $RCSfile: DescriptionGenerator.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: af $ $Date: 2002-05-29 15:03:03 $ + * last change: $Author: vg $ $Date: 2003-05-26 09:05:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -128,7 +128,7 @@ #include "xdef.hxx" #include "unoapi.hxx" #include "accessibility.hrc" - +#include "DGColorNameLookUp.hxx" using namespace ::rtl; using namespace ::com::sun::star; @@ -361,46 +361,7 @@ void DescriptionGenerator::AddColor (const OUString& sPropertyName, aValue >>= nValue; } - // Create color table in which to look up the given color. - uno::Reference<container::XNameContainer> xColorTable ( - ::comphelper::getProcessServiceFactory()->createInstance( - OUString::createFromAscii("com.sun.star.drawing.ColorTable")), - uno::UNO_QUERY); - - uno::Reference<container::XNameAccess> xNA (xColorTable, uno::UNO_QUERY); - if (xNA.is()) - { - // Get list of color names in order to iterate over the color - // table. - uno::Sequence<OUString> aNames; - { - // Look the solar mutex here as workarround for missing lock - // in called function. - ::vos::OGuard aGuard (::Application::GetSolarMutex()); - aNames = xNA->getElementNames(); - } - long i; - for (i=0; i<aNames.getLength(); i++) - { - // Compare the given color with the i-th entry of the table. - uno::Any aColor (xNA->getByName (aNames[i])); - long nColor; - aColor >>= nColor; - if (nColor == nValue) - { - // Found the given color. Append its name to the description. - msDescription.append (aNames[i]); - break; - } - } - if (i == aNames.getLength()) - { - // Did not find the given color. Append its rgb tuple to the - // description. - msDescription.append (sal_Unicode('#')); - msDescription.append (nValue, 16); - } - } + msDescription.append (DGColorNameLookUp::Instance().LookUpColor (nValue)); } catch (::com::sun::star::beans::UnknownPropertyException) { |