summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-09-18 15:39:21 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-09-18 15:39:21 +0000
commit9c270c1c4867ce8ef4d999995e7bf4928cc7cc2e (patch)
tree6223d34ee6dd441aaa1de45dbbafd4540807d55e
parent6b98c0f0a8623018a98a29b8e34f3c58383e6bc9 (diff)
CWS-TOOLING: integrate CWS impressaccessibility3
2009-09-18 16:10:59 +0200 af r276289 : #i102525# Fixed some minor compilation problems. 2009-09-17 14:11:23 +0200 af r276243 : #i102525# Fixed F1 shortcut for help view. 2009-09-16 16:20:58 +0200 af r276205 : #i102525# Removing const to make Solaris linker happy. 2009-09-16 16:13:25 +0200 af r276204 : #i90690# Initializing variable to avoid compilation problem. 2009-09-15 19:10:04 +0200 af r276186 : #i90825# Replace edit source proxy when an outliner object is set. 2009-09-15 11:12:07 +0200 af r276160 : #i90690# Broadcast accessibility events when the current slide is changed. 2009-09-15 09:37:48 +0200 af r276148 : #i102525# Fixed Solaris compilation problem. 2009-09-14 18:12:40 +0200 af r276142 : #i102525# Added missing implementation for some font related functions. 2009-09-14 18:02:05 +0200 af r276139 : #i102525# Added accessibility support. 2009-09-14 17:30:13 +0200 af r276136 : #i102525# Added support for interface XPane2 to panes. 2009-09-14 17:00:27 +0200 af r276133 : #i102525# Added XPane2 interface. 2009-09-14 16:13:04 +0200 af r276131 : #i50376# Make the focus indicator visible when the slide sorter has the focus.
-rw-r--r--sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx52
-rw-r--r--sd/source/ui/accessibility/AccessiblePageShape.cxx21
-rw-r--r--sd/source/ui/framework/factories/FullScreenPane.cxx122
-rw-r--r--sd/source/ui/framework/factories/FullScreenPane.hxx21
-rw-r--r--sd/source/ui/framework/factories/Pane.cxx57
-rw-r--r--sd/source/ui/inc/AccessibleDrawDocumentView.hxx3
-rw-r--r--sd/source/ui/inc/framework/Pane.hxx41
-rw-r--r--sd/source/ui/slidesorter/controller/SlideSorterController.cxx5
-rw-r--r--sd/source/ui/slidesorter/controller/SlsFocusManager.cxx3
-rw-r--r--sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx27
10 files changed, 324 insertions, 28 deletions
diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
index 5f86f7272..13e7dfd4f 100644
--- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
+++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
@@ -33,6 +33,7 @@
#include "AccessibleDrawDocumentView.hxx"
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/drawing/XDrawView.hpp>
+#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/frame/XController.hpp>
@@ -73,12 +74,15 @@
#include "sdresid.hxx"
#include <vos/mutex.hxx>
-using namespace ::rtl;
+using ::rtl::OUString;
using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::accessibility;
class SfxViewFrame;
+#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
+
namespace accessibility {
@@ -93,6 +97,7 @@ AccessibleDrawDocumentView::AccessibleDrawDocumentView (
mpChildrenManager (NULL)
{
OSL_TRACE ("AccessibleDrawDocumentView");
+ UpdateAccessibleName();
}
@@ -310,6 +315,9 @@ void SAL_CALL
{
OSL_TRACE (" current page changed");
+ // Update the accessible name to reflect the current slide.
+ UpdateAccessibleName();
+
// The current page changed. Update the children manager accordingly.
uno::Reference<drawing::XDrawView> xView (mxController, uno::UNO_QUERY);
if (xView.is() && mpChildrenManager!=NULL)
@@ -701,4 +709,46 @@ void SAL_CALL AccessibleDrawDocumentView::disposing (void)
+void AccessibleDrawDocumentView::UpdateAccessibleName (void)
+{
+ OUString sNewName (CreateAccessibleName());
+ sNewName += A2S(": ");
+
+ // Add the number of the current slide.
+ uno::Reference<drawing::XDrawView> xView (mxController, uno::UNO_QUERY);
+ if (xView.is())
+ {
+ uno::Reference<beans::XPropertySet> xProperties (xView->getCurrentPage(), UNO_QUERY);
+ if (xProperties.is())
+ try
+ {
+ sal_Int16 nPageNumber (0);
+ if (xProperties->getPropertyValue(A2S("Number")) >>= nPageNumber)
+ {
+ sNewName += OUString::valueOf(sal_Int32(nPageNumber));
+ }
+ }
+ catch (beans::UnknownPropertyException&)
+ {
+ }
+ }
+
+ // Add the number of pages/slides.
+ Reference<drawing::XDrawPagesSupplier> xPagesSupplier (mxModel, UNO_QUERY);
+ if (xPagesSupplier.is())
+ {
+ Reference<container::XIndexAccess> xPages (xPagesSupplier->getDrawPages(), UNO_QUERY);
+ if (xPages.is())
+ {
+ sNewName += A2S(" / ");
+ sNewName += OUString::valueOf(xPages->getCount());
+ }
+ }
+
+ SetAccessibleName (sNewName, AutomaticallyCreated);
+}
+
+
+
+
} // end of namespace accessibility
diff --git a/sd/source/ui/accessibility/AccessiblePageShape.cxx b/sd/source/ui/accessibility/AccessiblePageShape.cxx
index 6aff48bfb..e95ec4cfd 100644
--- a/sd/source/ui/accessibility/AccessiblePageShape.cxx
+++ b/sd/source/ui/accessibility/AccessiblePageShape.cxx
@@ -47,8 +47,12 @@
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::accessibility;
using ::com::sun::star::uno::Reference;
+using ::rtl::OUString;
+
+#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
namespace accessibility {
@@ -342,7 +346,22 @@ void AccessiblePageShape::dispose (void)
AccessiblePageShape::CreateAccessibleName (void)
throw (::com::sun::star::uno::RuntimeException)
{
- return CreateAccessibleBaseName();
+ Reference<beans::XPropertySet> xPageProperties (mxPage, UNO_QUERY);
+
+ // Get name of the current slide.
+ OUString sCurrentSlideName;
+ try
+ {
+ if (xPageProperties.is())
+ {
+ xPageProperties->getPropertyValue(A2S("LinkDisplayName")) >>= sCurrentSlideName;
+ }
+ }
+ catch (beans::UnknownPropertyException&)
+ {
+ }
+
+ return CreateAccessibleBaseName()+A2S(": ")+sCurrentSlideName;
}
diff --git a/sd/source/ui/framework/factories/FullScreenPane.cxx b/sd/source/ui/framework/factories/FullScreenPane.cxx
index a6159ebbc..65c83903d 100644
--- a/sd/source/ui/framework/factories/FullScreenPane.cxx
+++ b/sd/source/ui/framework/factories/FullScreenPane.cxx
@@ -36,10 +36,13 @@
#include <cppcanvas/vclfactory.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/topfrm.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/dialog.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/util/URL.hpp>
using namespace ::com::sun::star;
@@ -47,6 +50,8 @@ 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 sd { namespace framework {
FullScreenPane::FullScreenPane (
@@ -55,8 +60,13 @@ FullScreenPane::FullScreenPane (
const ::Window* pViewShellWindow)
: FrameWindowPane(rxPaneId,NULL),
mxComponentContext(rxComponentContext),
- mpWorkWindow(new WorkWindow(NULL, 0))
+ mpWorkWindow(NULL)
{
+ ::Window* pParent = NULL;
+ mpWorkWindow.reset(new WorkWindow(
+ pParent,
+ 0)); // For debugging (non-fullscreen) use WB_BORDER | WB_MOVEABLE | WB_SIZEABLE));
+
if ( ! rxPaneId.is())
throw lang::IllegalArgumentException();
@@ -68,10 +78,18 @@ FullScreenPane::FullScreenPane (
// Create a new top-leve window that is displayed full screen.
mpWorkWindow->ShowFullScreenMode(TRUE, nScreenNumber);
+ // For debugging (non-fullscreen) use mpWorkWindow->SetScreenNumber(nScreenNumber);
mpWorkWindow->SetMenuBarMode(MENUBAR_MODE_HIDE);
mpWorkWindow->SetBorderStyle(WINDOW_BORDER_REMOVEBORDER);
mpWorkWindow->SetBackground(Wallpaper());
- mpWorkWindow->Show();
+ // Don't show the window right now in order to allow the setting of an
+ // accessibility object: accessibility objects are typically
+ // requested by AT-tools when the window is shown. Chaning it
+ // afterwards may or may not work.
+
+ // Add resize listener at the work window.
+ Link aWindowEventHandler (LINK(this, FullScreenPane, WindowEventHandler));
+ mpWorkWindow->AddEventListener(aWindowEventHandler);
// Set title and icon of the new window to those of the current window
// of the view shell.
@@ -87,7 +105,6 @@ FullScreenPane::FullScreenPane (
// completely.
mpWindow = new ::Window(mpWorkWindow.get());
mpWindow->SetPosSizePixel(Point(0,0), mpWorkWindow->GetSizePixel());
- mpWindow->Show();
mpWindow->SetBackground(Wallpaper());
mxWindow = VCLUnoHelper::GetInterface(mpWindow);
@@ -115,7 +132,13 @@ void SAL_CALL FullScreenPane::disposing (void)
delete mpWindow;
}
- mpWorkWindow.reset();
+ if (mpWorkWindow.get() != NULL)
+ {
+ Link aWindowEventHandler (LINK(this, FullScreenPane, WindowEventHandler));
+ mpWorkWindow->RemoveEventListener(aWindowEventHandler);
+ mpWorkWindow.reset();
+ }
+
FrameWindowPane::disposing();
}
@@ -123,8 +146,99 @@ void SAL_CALL FullScreenPane::disposing (void)
+//----- XPane -----------------------------------------------------------------
+
+sal_Bool SAL_CALL FullScreenPane::isVisible (void)
+ throw (RuntimeException)
+{
+ ThrowIfDisposed();
+
+ if (mpWindow != NULL)
+ return mpWindow->IsReallyVisible();
+ else
+ return false;
+}
+
+
+
+
+void SAL_CALL FullScreenPane::setVisible (const sal_Bool bIsVisible)
+ throw (RuntimeException)
+{
+ ThrowIfDisposed();
+
+ if (mpWindow != NULL)
+ mpWindow->Show(bIsVisible);
+ if (mpWorkWindow != NULL)
+ mpWorkWindow->Show(bIsVisible);
+}
+
+
+
+
+Reference<accessibility::XAccessible> SAL_CALL FullScreenPane::getAccessible (void)
+ throw (RuntimeException)
+{
+ ThrowIfDisposed();
+
+ if (mpWorkWindow != NULL)
+ return mpWorkWindow->GetAccessible(FALSE);
+ else
+ return NULL;
+}
+
+
+
+
+void SAL_CALL FullScreenPane::setAccessible (
+ const Reference<accessibility::XAccessible>& rxAccessible)
+ throw (RuntimeException)
+{
+ ThrowIfDisposed();
+
+ if (mpWindow != NULL)
+ {
+ Reference<lang::XInitialization> xInitializable (rxAccessible, UNO_QUERY);
+ if (xInitializable.is())
+ {
+ ::Window* pParentWindow = mpWindow->GetParent();
+ Reference<accessibility::XAccessible> xAccessibleParent;
+ if (pParentWindow != NULL)
+ xAccessibleParent = pParentWindow->GetAccessible();
+ Sequence<Any> aArguments (1);
+ aArguments[0] = Any(xAccessibleParent);
+ xInitializable->initialize(aArguments);
+ }
+ GetWindow()->SetAccessible(rxAccessible);
+ }
+}
+
+
+
+
//-----------------------------------------------------------------------------
+IMPL_LINK(FullScreenPane, WindowEventHandler, VclWindowEvent*, pEvent)
+{
+ switch (pEvent->GetId())
+ {
+ case VCLEVENT_WINDOW_RESIZE:
+ GetWindow()->SetPosPixel(Point(0,0));
+ GetWindow()->SetSizePixel(Size(
+ mpWorkWindow->GetSizePixel().Width(),
+ mpWorkWindow->GetSizePixel().Height()));
+ break;
+
+ case VCLEVENT_OBJECT_DYING:
+ mpWorkWindow.reset();
+ break;
+ }
+ return 1;
+}
+
+
+
+
Reference<rendering::XCanvas> FullScreenPane::CreateCanvas (void)
throw (RuntimeException)
{
diff --git a/sd/source/ui/framework/factories/FullScreenPane.hxx b/sd/source/ui/framework/factories/FullScreenPane.hxx
index 480c191c0..8b68f8f48 100644
--- a/sd/source/ui/framework/factories/FullScreenPane.hxx
+++ b/sd/source/ui/framework/factories/FullScreenPane.hxx
@@ -35,6 +35,7 @@
#include "FrameWindowPane.hxx"
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <vcl/vclevent.hxx>
#include <boost/scoped_ptr.hpp>
namespace css = ::com::sun::star;
@@ -69,6 +70,26 @@ public:
virtual void SAL_CALL disposing (void);
+ //----- XPane -------------------------------------------------------------
+
+ virtual sal_Bool SAL_CALL isVisible (void)
+ throw (cssu::RuntimeException);
+
+ virtual void SAL_CALL setVisible (sal_Bool bIsVisible)
+ throw (cssu::RuntimeException);
+
+ virtual cssu::Reference<css::accessibility::XAccessible> SAL_CALL getAccessible (void)
+ throw (cssu::RuntimeException);
+
+ virtual void SAL_CALL setAccessible (
+ const cssu::Reference<css::accessibility::XAccessible>& rxAccessible)
+ throw (cssu::RuntimeException);
+
+
+ //-------------------------------------------------------------------------
+
+ DECL_LINK(WindowEventHandler, VclWindowEvent*);
+
protected:
virtual ::com::sun::star::uno::Reference<com::sun::star::rendering::XCanvas>
CreateCanvas (void)
diff --git a/sd/source/ui/framework/factories/Pane.cxx b/sd/source/ui/framework/factories/Pane.cxx
index 1b0388710..abfbfbc34 100644
--- a/sd/source/ui/framework/factories/Pane.cxx
+++ b/sd/source/ui/framework/factories/Pane.cxx
@@ -117,6 +117,63 @@ Reference<rendering::XCanvas> SAL_CALL Pane::getCanvas (void)
+//----- XPane2 ----------------------------------------------------------------
+
+sal_Bool SAL_CALL Pane::isVisible (void)
+ throw (RuntimeException)
+{
+ ThrowIfDisposed();
+
+ const ::Window* pWindow = GetWindow();
+ if (pWindow != NULL)
+ return pWindow->IsVisible();
+ else
+ return false;
+}
+
+
+
+
+void SAL_CALL Pane::setVisible (sal_Bool bIsVisible)
+ throw (RuntimeException)
+{
+ ThrowIfDisposed();
+
+ ::Window* pWindow = GetWindow();
+ if (pWindow != NULL)
+ pWindow->Show(bIsVisible);
+}
+
+
+
+
+Reference<accessibility::XAccessible> SAL_CALL Pane::getAccessible (void)
+ throw (RuntimeException)
+{
+ ThrowIfDisposed();
+ ::Window* pWindow = GetWindow();
+ if (pWindow != NULL)
+ return pWindow->GetAccessible(FALSE);
+ else
+ return NULL;
+}
+
+
+
+
+void SAL_CALL Pane::setAccessible (
+ const Reference<accessibility::XAccessible>& rxAccessible)
+ throw (RuntimeException)
+{
+ ThrowIfDisposed();
+ ::Window* pWindow = GetWindow();
+ if (pWindow != NULL)
+ pWindow->SetAccessible(rxAccessible);
+}
+
+
+
+
//----- XResource -------------------------------------------------------------
Reference<XResourceId> SAL_CALL Pane::getResourceId (void)
diff --git a/sd/source/ui/inc/AccessibleDrawDocumentView.hxx b/sd/source/ui/inc/AccessibleDrawDocumentView.hxx
index f1635eb2f..c6404c2c0 100644
--- a/sd/source/ui/inc/AccessibleDrawDocumentView.hxx
+++ b/sd/source/ui/inc/AccessibleDrawDocumentView.hxx
@@ -166,6 +166,9 @@ protected:
virtual void Deactivated (void);
virtual void impl_dispose (void);
+
+private:
+ void UpdateAccessibleName (void);
};
} // end of namespace accessibility
diff --git a/sd/source/ui/inc/framework/Pane.hxx b/sd/source/ui/inc/framework/Pane.hxx
index d65843275..da9b88a22 100644
--- a/sd/source/ui/inc/framework/Pane.hxx
+++ b/sd/source/ui/inc/framework/Pane.hxx
@@ -34,19 +34,24 @@
#include "MutexOwner.hxx"
#include <com/sun/star/drawing/framework/XPane.hpp>
+#include <com/sun/star/drawing/framework/XPane2.hpp>
#include <com/sun/star/drawing/framework/TabBarButton.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <cppuhelper/compbase2.hxx>
+#include <cppuhelper/compbase3.hxx>
#include <tools/link.hxx>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
class Window;
+namespace css = ::com::sun::star;
+namespace cssu = ::com::sun::star::uno;
+
namespace {
-typedef ::cppu::WeakComponentImplHelper2 <
+typedef ::cppu::WeakComponentImplHelper3 <
::com::sun::star::drawing::framework::XPane,
+ ::com::sun::star::drawing::framework::XPane2,
::com::sun::star::lang::XUnoTunnel
> PaneInterfaceBase;
@@ -96,22 +101,39 @@ public:
*/
virtual ::Window* GetWindow (void);
- // XPane
+
+ //----- XPane -------------------------------------------------------------
/** For a UNO API based implementation of a view this may the most
important method of this class because the view is only interested
in the window of the pane.
*/
- virtual ::com::sun::star::uno::Reference<com::sun::star::awt::XWindow>
+ virtual cssu::Reference<css::awt::XWindow>
SAL_CALL getWindow (void)
- throw (::com::sun::star::uno::RuntimeException);
+ throw (cssu::RuntimeException);
- virtual ::com::sun::star::uno::Reference<com::sun::star::rendering::XCanvas>
+ virtual cssu::Reference<css::rendering::XCanvas>
SAL_CALL getCanvas (void)
- throw (::com::sun::star::uno::RuntimeException);
+ throw (cssu::RuntimeException);
+
+ //----- XPane2 -------------------------------------------------------------
- // XResource
+ virtual sal_Bool SAL_CALL isVisible (void)
+ throw (cssu::RuntimeException);
+
+ virtual void SAL_CALL setVisible (sal_Bool bIsVisible)
+ throw (cssu::RuntimeException);
+
+ virtual cssu::Reference<css::accessibility::XAccessible> SAL_CALL getAccessible (void)
+ throw (cssu::RuntimeException);
+
+ virtual void SAL_CALL setAccessible (
+ const cssu::Reference<css::accessibility::XAccessible>& rxAccessible)
+ throw (cssu::RuntimeException);
+
+
+ //----- XResource ---------------------------------------------------------
virtual ::com::sun::star::uno::Reference<com::sun::star::drawing::framework::XResourceId>
SAL_CALL getResourceId (void)
@@ -124,11 +146,12 @@ public:
throw (com::sun::star::uno::RuntimeException);
- // XUnoTunnel
+ //----- XUnoTunnel --------------------------------------------------------
virtual sal_Int64 SAL_CALL getSomething (const com::sun::star::uno::Sequence<sal_Int8>& rId)
throw (com::sun::star::uno::RuntimeException);
+
protected:
::com::sun::star::uno::Reference<com::sun::star::drawing::framework::XResourceId> mxPaneId;
::Window* mpWindow;
diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
index 15ebffe1b..c8355752c 100644
--- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
+++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
@@ -603,11 +603,8 @@ IMPL_LINK(SlideSorterController, WindowEventHandler, VclWindowEvent*, pEvent)
break;
case VCLEVENT_WINDOW_GETFOCUS:
- // Show focus but only when the focus was not set to the
- // window as a result of a mouse click.
if (pActiveWindow != NULL && pWindow == pActiveWindow)
- if (pWindow->GetPointerState().mnState==0)
- GetFocusManager().ShowFocus();
+ GetFocusManager().ShowFocus();
break;
case VCLEVENT_WINDOW_LOSEFOCUS:
diff --git a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx
index fe459abb7..9cb8c7d38 100644
--- a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx
@@ -205,6 +205,9 @@ void FocusManager::FocusPage (sal_Int32 nPageIndex)
FocusHider aHider (*this);
mnPageIndex = nPageIndex;
}
+
+ if (HasFocus() && !IsFocusShowing())
+ ShowFocus();
}
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx
index 84e3be9c1..a5d861a86 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx
@@ -520,6 +520,7 @@ class SdPageObjectFocusPrimitive : public SdPageObjectBasePrimitive
private:
/// Gap between border of page object and inside of focus rectangle.
static const sal_Int32 mnFocusIndicatorOffset;
+ const bool mbContrastToSelected;
protected:
// method which is to be used to implement the local decomposition of a 2D primitive.
@@ -527,7 +528,7 @@ protected:
public:
// constructor and destructor
- SdPageObjectFocusPrimitive(const basegfx::B2DRange& rRange);
+ SdPageObjectFocusPrimitive(const basegfx::B2DRange& rRange, const bool bContrast);
~SdPageObjectFocusPrimitive();
// provide unique ID
@@ -556,19 +557,26 @@ Primitive2DSequence SdPageObjectFocusPrimitive::createLocalDecomposition(const d
// create polygon
const basegfx::B2DPolygon aIndicatorPolygon(basegfx::tools::createPolygonFromRect(aFocusIndicatorRange));
- // white rectangle
+ const StyleSettings& rStyleSettings(Application::GetSettings().GetStyleSettings());
+
+ // "background" rectangle
+ const Color aBackgroundColor(mbContrastToSelected ? rStyleSettings.GetMenuHighlightColor() : rStyleSettings.GetWindowColor());
xRetval[0] = Primitive2DReference(
new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aIndicatorPolygon, Color(COL_WHITE).getBColor()));
// dotted black rectangle with same geometry
::std::vector< double > aDotDashArray;
- aDotDashArray.push_back(aDiscretePixel.getX());
- aDotDashArray.push_back(aDiscretePixel.getX());
+ const sal_Int32 nFocusIndicatorWidth (3);
+ aDotDashArray.push_back(nFocusIndicatorWidth *aDiscretePixel.getX());
+ aDotDashArray.push_back(nFocusIndicatorWidth * aDiscretePixel.getX());
// prepare line and stroke attributes
- const drawinglayer::attribute::LineAttribute aLineAttribute(Color(COL_BLACK).getBColor());
- const drawinglayer::attribute::StrokeAttribute aStrokeAttribute(aDotDashArray, 2.0 * aDiscretePixel.getX());
+ const Color aLineColor(mbContrastToSelected ? rStyleSettings.GetMenuHighlightTextColor() : rStyleSettings.GetWindowTextColor());
+ const drawinglayer::attribute::LineAttribute aLineAttribute(aLineColor.getBColor());
+ const drawinglayer::attribute::StrokeAttribute aStrokeAttribute(
+ aDotDashArray, 2.0 * nFocusIndicatorWidth * aDiscretePixel.getX());
+
xRetval[1] = Primitive2DReference(
new drawinglayer::primitive2d::PolygonStrokePrimitive2D(aIndicatorPolygon, aLineAttribute, aStrokeAttribute));
@@ -576,8 +584,9 @@ Primitive2DSequence SdPageObjectFocusPrimitive::createLocalDecomposition(const d
return xRetval;
}
-SdPageObjectFocusPrimitive::SdPageObjectFocusPrimitive(const basegfx::B2DRange& rRange)
-: SdPageObjectBasePrimitive(rRange)
+SdPageObjectFocusPrimitive::SdPageObjectFocusPrimitive(const basegfx::B2DRange& rRange, const bool bContrast)
+ : SdPageObjectBasePrimitive(rRange),
+ mbContrastToSelected(bContrast)
{
}
@@ -1094,7 +1103,7 @@ Primitive2DSequence PageObjectViewObjectContact::createPrimitive2DSequence(const
if(bCreateFocused)
{
// add focus indicator if used
- xRetval[nInsert++] = Primitive2DReference(new SdPageObjectFocusPrimitive(aInnerRange));
+ xRetval[nInsert++] = Primitive2DReference(new SdPageObjectFocusPrimitive(aInnerRange, bCreateSelected));
}
return xRetval;