[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 5 commits - drawinglayer/inc drawinglayer/source sc/source sfx2/inc sfx2/Library_sfx.mk sfx2/source svx/source vcl/inc vcl/source

Andre Fischer af at apache.org
Fri May 10 06:09:23 PDT 2013


 drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx |   14 
 drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx      |    2 
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx           |  257 +++++++++-
 drawinglayer/source/processor2d/vclprocessor2d.cxx                |   80 ---
 sc/source/ui/sidebar/AlignmentPropertyPanel.hxx                   |    1 
 sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx              |    1 
 sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx                |    3 
 sfx2/Library_sfx.mk                                               |    2 
 sfx2/inc/sfx2/sidebar/ControllerItem.hxx                          |    2 
 sfx2/inc/sfx2/sidebar/IContextChangeReceiver.hxx                  |    6 
 sfx2/inc/sfx2/sidebar/ILayoutableWindow.hxx                       |    5 
 sfx2/inc/sfx2/sidebar/SidebarPanelBase.hxx                        |    3 
 sfx2/source/sidebar/ControllerItem.cxx                            |   10 
 svx/source/sidebar/insert/InsertPropertyPanel.cxx                 |    9 
 svx/source/sidebar/insert/SimpleToolBoxController.cxx             |   85 ---
 svx/source/sidebar/insert/SimpleToolBoxController.hxx             |   54 --
 svx/source/sidebar/text/TextPropertyPanel.cxx                     |   70 +-
 svx/source/sidebar/text/TextPropertyPanel.hxx                     |    1 
 svx/source/sidebar/text/TextPropertyPanel.src                     |   16 
 vcl/inc/vcl/outdev.hxx                                            |    7 
 vcl/source/gdi/outdev.cxx                                         |   58 ++
 21 files changed, 398 insertions(+), 288 deletions(-)

New commits:
commit 784ed0d2e9cc2de7e3de8420d4708ee5c4631a5c
Author: Andre Fischer <af at apache.org>
Date:   Fri May 10 11:30:31 2013 +0000

    122218: Replaced local tool box controller with existing GenericToolboxController (cleanup).

diff --git a/svx/source/sidebar/insert/InsertPropertyPanel.cxx b/svx/source/sidebar/insert/InsertPropertyPanel.cxx
index 4f4c3bb..2403f43 100755
--- a/svx/source/sidebar/insert/InsertPropertyPanel.cxx
+++ b/svx/source/sidebar/insert/InsertPropertyPanel.cxx
@@ -23,7 +23,6 @@
 
 #include "InsertPropertyPanel.hxx"
 #include "InsertPropertyPanel.hrc"
-#include "SimpleToolBoxController.hxx"
 #include "sfx2/sidebar/CommandInfoProvider.hxx"
 
 #include <sfx2/sidebar/Theme.hxx>
@@ -32,6 +31,7 @@
 
 #include <svx/dialmgr.hxx>
 #include <svtools/miscopt.hxx>
+#include <svtools/generictoolboxcontroller.hxx>
 #include <vcl/toolbox.hxx>
 #include <sfx2/tbxctrl.hxx>
 #include <framework/sfxhelperfunctions.hxx>
@@ -281,7 +281,12 @@ void InsertPropertyPanel::CreateController (
             UNO_QUERY);
         if ( ! aDescriptor.mxController.is())
             aDescriptor.mxController.set(
-                static_cast<XWeak*>(new SimpleToolBoxController(mxFrame, *pToolBox, nItemId, sCommandName)),
+                static_cast<XWeak*>(new svt::GenericToolboxController(
+                        ::comphelper::getProcessServiceFactory(),
+                        mxFrame,
+                        pToolBox,
+                        nItemId,
+                        sCommandName)),
                 UNO_QUERY);
         if ( ! aDescriptor.mxController.is())
             return;
diff --git a/svx/source/sidebar/insert/SimpleToolBoxController.cxx b/svx/source/sidebar/insert/SimpleToolBoxController.cxx
deleted file mode 100755
index dda97d9..0000000
--- a/svx/source/sidebar/insert/SimpleToolBoxController.cxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-#include "precompiled_svx.hxx"
-
-#include "SimpleToolBoxController.hxx"
-
-#include <comphelper/processfactory.hxx>
-#include <vcl/toolbox.hxx>
-#include <vos/mutex.hxx>
-#include <vcl/svapp.hxx>
-
-
-using namespace ::com::sun::star;
-
-namespace svx { namespace sidebar {
-
-SimpleToolBoxController::SimpleToolBoxController(
-    const cssu::Reference<css::frame::XFrame>& rxFrame,
-    ToolBox& rToolBox,
-    const sal_uInt16 nItemId,
-    const rtl::OUString& rsCommand)
-    : svt::ToolboxController(::comphelper::getProcessServiceFactory(), rxFrame, rsCommand),
-      mrToolbox(rToolBox),
-      mnItemId(nItemId)
-{
-}
-
-
-
-
-SimpleToolBoxController::~SimpleToolBoxController (void)
-{
-}
-
-
-
-
-void SAL_CALL SimpleToolBoxController::statusChanged (const css::frame::FeatureStateEvent& rEvent)
-    throw (cssu::RuntimeException)
-{
-    vos::OGuard aSolarMutexGuard (Application::GetSolarMutex());
-
-    if (m_bDisposed)
-        return;
-
-    mrToolbox.EnableItem(mnItemId, rEvent.IsEnabled);
-
-    sal_uInt16 nItemBits = mrToolbox.GetItemBits(mnItemId);
-    nItemBits &= ~TIB_CHECKABLE;
-    TriState eState = STATE_NOCHECK;
-
-    sal_Bool bValue = sal_False;
-    if (rEvent.State >>= bValue)
-    {
-        // Boolean, treat it as checked/unchecked
-        mrToolbox.CheckItem(mnItemId, bValue);
-        if ( bValue )
-            eState = STATE_CHECK;
-        nItemBits |= TIB_CHECKABLE;
-    }
-
-    mrToolbox.SetItemState(mnItemId, eState);
-    mrToolbox.SetItemBits(mnItemId, nItemBits);
-}
-
-} } // end of namespace svx::sidebar
diff --git a/svx/source/sidebar/insert/SimpleToolBoxController.hxx b/svx/source/sidebar/insert/SimpleToolBoxController.hxx
deleted file mode 100755
index 0e4071f..0000000
--- a/svx/source/sidebar/insert/SimpleToolBoxController.hxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-#ifndef SVX_SIDEBAR_INSERT_SIMPLE_TOOLBOX_CONTROLLER_HXX
-#define SVX_SIDEBAR_INSERT_SIMPLE_TOOLBOX_CONTROLLER_HXX
-
-#include <svtools/toolboxcontroller.hxx>
-
-namespace css = ::com::sun::star;
-namespace cssu = ::com::sun::star::uno;
-
-namespace svx { namespace sidebar {
-
-class SimpleToolBoxController : public svt::ToolboxController
-{
-public:
-    SimpleToolBoxController(
-        const cssu::Reference<css::frame::XFrame>& rxFrame,
-        ToolBox& rToolBox,
-        const sal_uInt16 nItTemId,
-        const rtl::OUString& rsComand);
-    virtual ~SimpleToolBoxController (void);
-
-    // XStatusListener
-    virtual void SAL_CALL statusChanged (const css::frame::FeatureStateEvent& rEvent)
-        throw (cssu::RuntimeException);
-
-private:
-    ToolBox& mrToolbox;
-    const sal_uInt16 mnItemId;
-};
-
-} } // end of namespace svx::sidebar
-
-
-#endif
commit 8f3625e6cf098c3fd5e6701b7b687a0423d78f51
Author: Andre Fischer <af at apache.org>
Date:   Fri May 10 11:03:45 2013 +0000

    122047: Adding virutal destructors to interfaces to prevent problems with older compilers.

diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
index 3693d18..6ae2e4a 100755
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
@@ -22,7 +22,6 @@
 #ifndef SC_PROPERTYPANEL_ALIGNMENT_HXX
 #define SC_PROPERTYPANEL_ALIGNMENT_HXX
 
-#include <sfx2/sidebar/SidebarPanelBase.hxx>
 #include <sfx2/sidebar/ControllerItem.hxx>
 #include <sfx2/sidebar/IContextChangeReceiver.hxx>
 #include <vcl/fixed.hxx>
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
index 08f30dd..c422486 100755
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
@@ -22,7 +22,6 @@
 #ifndef SC_PROPERTYPANEL_APPEARANCE_HXX
 #define SC_PROPERTYPANEL_APPEARANCE_HXX
 
-#include <sfx2/sidebar/SidebarPanelBase.hxx>
 #include <sfx2/sidebar/ControllerItem.hxx>
 #include <sfx2/sidebar/IContextChangeReceiver.hxx>
 #include <boost/scoped_ptr.hpp>
diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx
index 762f6a1..3795251 100755
--- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx
+++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx
@@ -22,7 +22,6 @@
 #ifndef SC_PROPERTYPANEL_NUMFORMAT_HXX
 #define SC_PROPERTYPANEL_NUMFORMAT_HXX
 
-#include <sfx2/sidebar/SidebarPanelBase.hxx>
 #include <sfx2/sidebar/ControllerItem.hxx>
 #include <sfx2/sidebar/IContextChangeReceiver.hxx>
 #include <boost/scoped_ptr.hpp>
@@ -97,6 +96,6 @@ private:
 
 } } // end of namespace ::sc::sidebar
 
-#endif SC_PROPERTYPANEL_NUMFORMAT_HXX
+#endif
 
 // eof
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 9a14410..c10196b 100755
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -234,6 +234,8 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
     sfx2/source/sidebar/EnumContext \
     sfx2/source/sidebar/FocusManager \
     sfx2/source/sidebar/MenuButton \
+    sfx2/source/sidebar/IContextChangeReceiver \
+    sfx2/source/sidebar/ILayoutableWindow \
     sfx2/source/sidebar/Paint \
     sfx2/source/sidebar/Panel \
     sfx2/source/sidebar/PanelDescriptor \
diff --git a/sfx2/inc/sfx2/sidebar/IContextChangeReceiver.hxx b/sfx2/inc/sfx2/sidebar/IContextChangeReceiver.hxx
index e495e65..5fd8f25 100644
--- a/sfx2/inc/sfx2/sidebar/IContextChangeReceiver.hxx
+++ b/sfx2/inc/sfx2/sidebar/IContextChangeReceiver.hxx
@@ -23,6 +23,7 @@
 #define SFX_SIDEBAR_CONTEXT_CHANGE_RECEIVER_INTERFACE_HXX
 
 #include "EnumContext.hxx"
+#include "sfx2/dllapi.h"
 
 
 namespace sfx2 { namespace sidebar {
@@ -31,8 +32,9 @@ namespace sfx2 { namespace sidebar {
 class SFX2_DLLPUBLIC IContextChangeReceiver
 {
 public:
-    virtual void HandleContextChange (
-        const EnumContext aContext) = 0;
+    virtual ~IContextChangeReceiver (void);
+
+    virtual void HandleContextChange (const EnumContext aContext) = 0;
 };
 
 } } // end of namespace ::sd::sidebar
diff --git a/sfx2/inc/sfx2/sidebar/ILayoutableWindow.hxx b/sfx2/inc/sfx2/sidebar/ILayoutableWindow.hxx
index 22b0efc..024acab 100644
--- a/sfx2/inc/sfx2/sidebar/ILayoutableWindow.hxx
+++ b/sfx2/inc/sfx2/sidebar/ILayoutableWindow.hxx
@@ -22,6 +22,7 @@
 #ifndef SFX_SIDEBAR_LAYOUTABLE_WINDOW_INTERFACE_HXX
 #define SFX_SIDEBAR_LAYOUTABLE_WINDOW_INTERFACE_HXX
 
+#include "sfx2/dllapi.h"
 #include <tools/gen.hxx>
 #include <sal/types.h>
 
@@ -32,9 +33,11 @@ class Window;
 namespace sfx2 { namespace sidebar {
 
 
-class ILayoutableWindow
+class SFX2_DLLPUBLIC ILayoutableWindow
 {
 public:
+    virtual ~ILayoutableWindow (void);
+
     /** Return the preferred height with the constraint, that the
         window will be set to the given width.
     */
diff --git a/sfx2/inc/sfx2/sidebar/SidebarPanelBase.hxx b/sfx2/inc/sfx2/sidebar/SidebarPanelBase.hxx
index 9f894e0..97c5b04 100644
--- a/sfx2/inc/sfx2/sidebar/SidebarPanelBase.hxx
+++ b/sfx2/inc/sfx2/sidebar/SidebarPanelBase.hxx
@@ -23,6 +23,7 @@
 #define SFX_SIDEBAR_PANEL_BASE_HXX
 
 #include "EnumContext.hxx"
+#include "IContextChangeReceiver.hxx"
 
 #include <cppuhelper/compbase4.hxx>
 #include <cppuhelper/basemutex.hxx>
@@ -67,7 +68,7 @@ public:
     static cssu::Reference<css::ui::XUIElement> Create (
         const ::rtl::OUString& rsResourceURL,
         const cssu::Reference<css::frame::XFrame>& rxFrame,
-        Window* mpWindow,
+        Window* pControl,
         const css::ui::LayoutSize& rLayoutSize);
 
     // XContextChangeEventListener
commit f213ea43fac43326a643f30ff13abd9d77f6aed7
Author: Andre Fischer <af at apache.org>
Date:   Fri May 10 09:00:58 2013 +0000

    122082: Remove temporary change.

diff --git a/svx/source/sidebar/text/TextPropertyPanel.hxx b/svx/source/sidebar/text/TextPropertyPanel.hxx
index 54ce1a6..8b2781b 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.hxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.hxx
@@ -61,7 +61,6 @@ public:
         SfxBindings* pBindings);
 
     virtual void DataChanged (const DataChangedEvent& rEvent);
-    virtual void Resize (void);
 
     ::sfx2::sidebar::ControllerItem& GetSpaceController();
     long GetSelFontSize();
commit ffcc8c326640dfbc6b765cd25875adf9e0ab66ad
Author: Andre Fischer <af at apache.org>
Date:   Fri May 10 08:51:15 2013 +0000

    122082: Disable controls of text property sidebar panel for disabled document parts.

diff --git a/sfx2/inc/sfx2/sidebar/ControllerItem.hxx b/sfx2/inc/sfx2/sidebar/ControllerItem.hxx
index aaecd44..0641e38 100644
--- a/sfx2/inc/sfx2/sidebar/ControllerItem.hxx
+++ b/sfx2/inc/sfx2/sidebar/ControllerItem.hxx
@@ -91,7 +91,7 @@ public:
         Changes of this state are notified via the
         ItemUpdateReceiverInterface::NotifyContextChang() method.
     */
-    bool IsEnabled (void) const;
+    bool IsEnabled (const SfxItemState eState) const;
 
     /** Force the controller item to call its NotifyItemUpdate
         callback with up-to-date data.
diff --git a/sfx2/source/sidebar/ControllerItem.cxx b/sfx2/source/sidebar/ControllerItem.cxx
index d549a0d..a4b6a08 100644
--- a/sfx2/source/sidebar/ControllerItem.cxx
+++ b/sfx2/source/sidebar/ControllerItem.cxx
@@ -139,15 +139,17 @@ void ControllerItem::StateChanged (
     SfxItemState eState,
     const SfxPoolItem* pState)
 {
-    mrItemUpdateReceiver.NotifyItemUpdate(nSID, eState, pState, IsEnabled());
+    mrItemUpdateReceiver.NotifyItemUpdate(nSID, eState, pState, IsEnabled(eState));
 }
 
 
 
 
-bool ControllerItem::IsEnabled (void) const
+bool ControllerItem::IsEnabled (SfxItemState eState) const
 {
-    if ( ! SvtCommandOptions().HasEntries(SvtCommandOptions::CMDOPTION_DISABLED))
+    if (eState == SFX_ITEM_DISABLED)
+        return false;
+    else if ( ! SvtCommandOptions().HasEntries(SvtCommandOptions::CMDOPTION_DISABLED))
     {
         // There are no disabled commands.
         return true;
@@ -174,7 +176,7 @@ void ControllerItem::RequestUpdate (void)
 {
     SfxPoolItem* pState = NULL;
     const SfxItemState eState (GetBindings().QueryState(GetId(), pState));
-    mrItemUpdateReceiver.NotifyItemUpdate(GetId(), eState, pState, IsEnabled());
+    mrItemUpdateReceiver.NotifyItemUpdate(GetId(), eState, pState, IsEnabled(eState));
 }
 
 
diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx
index 727d43c..58d209c 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.cxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.cxx
@@ -45,6 +45,7 @@
 #include <sfx2/sidebar/ResourceDefinitions.hrc>
 #include <sfx2/sidebar/ControlFactory.hxx>
 #include <sfx2/sidebar/Theme.hxx>
+#include <sfx2/sidebar/PanelLayouter.hxx>
 #include "sfx2/imagemgr.hxx"
 #include <svtools/ctrltool.hxx>
 #include <svtools/unitconv.hxx>
@@ -73,17 +74,8 @@ namespace svx { namespace sidebar {
 #undef HAS_IA2
 
 
-#define FONT_CONTROL_WIDTH      160
-#define SIZE_CONTROL_WIDTH      80
-#define CONTROL_COMBOX_HEIGHT   20
-#define CONTROL_HEIGHT_5X       120
 
-
-#define TEXT_SECTIONPAGE_HEIGHT_S   SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT  + ( TOOLBOX_ITEM_HEIGHT + 2 ) + CONTROL_SPACING_VERTICAL * 1 + SECTIONPAGE_MARGIN_VERTICAL_BOT
-#define TEXT_SECTIONPAGE_HEIGHT     SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT  + ( TOOLBOX_ITEM_HEIGHT + 2 ) * 2 + CONTROL_SPACING_VERTICAL * 2 + SECTIONPAGE_MARGIN_VERTICAL_BOT
-
-
-    PopupControl* TextPropertyPanel::CreateCharacterSpacingControl (PopupContainer* pParent)
+PopupControl* TextPropertyPanel::CreateCharacterSpacingControl (PopupContainer* pParent)
 {
     return new TextCharacterSpacingControl(pParent, *this, mpBindings);
 }
@@ -344,6 +336,7 @@ void TextPropertyPanel::DataChanged (const DataChangedEvent& rEvent)
 
 
 
+
 void TextPropertyPanel::Initialize (void)
 {
     //<<modify fill font list
@@ -429,11 +422,6 @@ void TextPropertyPanel::Initialize (void)
     maFontSizeBox.SetSelectHdl(aLink);
     aLink = LINK(this, TextPropertyPanel, FontSizeLoseFocus);
     maFontSizeBox.SetLoseFocusHdl(aLink);
-
-    Size aSize(PROPERTYPAGE_WIDTH, TEXT_SECTIONPAGE_HEIGHT);
-    aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) );
-    aSize.setWidth(GetOutputSizePixel().Width());
-    SetSizePixel(aSize);
 }
 
 void TextPropertyPanel::EndSpacingPopupMode (void)
@@ -953,16 +941,38 @@ void TextPropertyPanel::NotifyItemUpdate (
             {
                 mpHeightItem = (SvxFontHeightItem*)pState;//const SvxFontHeightItem*
                 SfxMapUnit eUnit = maFontSizeControl.GetCoreMetric();
-                long iValue = (long)CalcToPoint( mpHeightItem->GetHeight(), eUnit, 10 );
+                const sal_Int64 nValue (CalcToPoint(mpHeightItem->GetHeight(), eUnit, 10 ));
                 mpToolBoxIncDec->Enable();
 
                 mpToolBoxIncDec->SetItemState(TBI_INCREASE, STATE_NOCHECK);
                 mpToolBoxIncDec->SetItemState(TBI_DECREASE, STATE_NOCHECK);
 
+                // For Writer we have to update the states of the
+                // increase and decrease buttons here, because we have
+                // no access to the slots used by Writer.
+                switch(maContext.GetCombinedContext_DI())
+                {
+                    case CombinedEnumContext(Application_DrawImpress, Context_DrawText):
+                    case CombinedEnumContext(Application_DrawImpress, Context_Text):
+                    case CombinedEnumContext(Application_DrawImpress, Context_Table):
+                    case CombinedEnumContext(Application_DrawImpress, Context_OutlineText):
+                    case CombinedEnumContext(Application_DrawImpress, Context_Draw):
+                    case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
+                    case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
+                        break;
+
+                    default:
+                    {
+                        mpToolBoxIncDec->EnableItem(TBI_INCREASE, bIsEnabled && nValue<960);
+                        mpToolBoxIncDec->EnableItem(TBI_DECREASE, bIsEnabled && nValue>60);
+                        break;
+                    }
+                }
+
                 if( mbFocusOnFontSizeCtrl )
                     return;
 
-                maFontSizeBox.SetValue( iValue );
+                maFontSizeBox.SetValue(nValue);
                 maFontSizeBox.LoseFocus();
 
                 UpdateItem(SID_SHRINK_FONT_SIZE);
@@ -1156,8 +1166,8 @@ void TextPropertyPanel::NotifyItemUpdate (
             {
                 meEscape = SVX_ESCAPEMENT_OFF;
             }
-            mpToolBoxScriptSw->EnableItem(TBI_SUPER, bIsItemEnabled && bIsEnabled);
-            mpToolBoxScriptSw->EnableItem(TBI_SUB, bIsItemEnabled && bIsEnabled);
+            mpToolBoxScriptSw->EnableItem(TBI_SUPER_SW, bIsItemEnabled && bIsEnabled);
+            mpToolBoxScriptSw->EnableItem(TBI_SUB_SW, bIsItemEnabled && bIsEnabled);
             break;
         }
 
@@ -1233,17 +1243,27 @@ void TextPropertyPanel::NotifyItemUpdate (
                 case CombinedEnumContext(Application_DrawImpress, Context_Draw):
                 case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
                 case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
+                {
                     if(eState == SFX_ITEM_DISABLED)
                         mpToolBoxIncDec->Disable();
                     else
                         mpToolBoxIncDec->Enable();
-                break;
+                    const sal_Int64 nSize (maFontSizeBox.GetValue());
+                    switch(nSID)
+                    {
+                        case SID_GROW_FONT_SIZE:
+                            mpToolBoxIncDec->EnableItem(TBI_INCREASE, bIsEnabled && nSize<960);
+                            break;
+
+                        case SID_SHRINK_FONT_SIZE:
+                            mpToolBoxIncDec->EnableItem(TBI_DECREASE, bIsEnabled && nSize>60);
+                            break;
+
+                        default:
+                            break;
+                    }
+                }
             }
-            const sal_Int32 nSize (maFontSizeBox.GetValue());
-            if (nSID == SID_GROW_FONT_SIZE)
-                mpToolBoxIncDec->EnableItem(TBI_INCREASE, bIsEnabled && nSize<960);
-            else
-                mpToolBoxIncDec->EnableItem(TBI_DECREASE, bIsEnabled && nSize>60);
             break;
     }
 }
diff --git a/svx/source/sidebar/text/TextPropertyPanel.hxx b/svx/source/sidebar/text/TextPropertyPanel.hxx
index 39dc4cf..54ce1a6 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.hxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.hxx
@@ -61,6 +61,8 @@ public:
         SfxBindings* pBindings);
 
     virtual void DataChanged (const DataChangedEvent& rEvent);
+    virtual void Resize (void);
+
     ::sfx2::sidebar::ControllerItem& GetSpaceController();
     long GetSelFontSize();
     void SetSpacing(long nKern);
diff --git a/svx/source/sidebar/text/TextPropertyPanel.src b/svx/source/sidebar/text/TextPropertyPanel.src
index da264dd..9e33ed8 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.src
+++ b/svx/source/sidebar/text/TextPropertyPanel.src
@@ -64,6 +64,7 @@ Control RID_SIDEBAR_TEXT_PANEL
         DropDown = TRUE;
         HelpID = HID_COMBO_FONT_NAME ;
         QuickHelpText [ en-US ] = "Font";
+//        Command = ".uno:CharFontName";
     };
     MetricBox MB_SBFONT_FONTSIZE
     {
@@ -74,6 +75,7 @@ Control RID_SIDEBAR_TEXT_PANEL
         DropDown = TRUE;
         HelpID = HID_METRIC_FONT_SIZE;
         QuickHelpText [ en-US ] = "Font Size";
+//        Command = ".uno:FontHeight";
     };
 
     ToolBox TB_INCREASE_DECREASE
@@ -90,11 +92,13 @@ Control RID_SIDEBAR_TEXT_PANEL
             {
                 Identifier = TBI_INCREASE;
                 HelpID = HID_PPROPERTYPANEL_TEXT_TBI_INCREASE;
+                Command = ".uno:Grow";
             };
             ToolBoxItem
             {
                 Identifier = TBI_DECREASE;
                 HelpID = HID_PPROPERTYPANEL_TEXT_TBI_DECREASE;
+                Command = ".uno:Shrink";
             };
         };
     };
@@ -112,27 +116,32 @@ Control RID_SIDEBAR_TEXT_PANEL
             {
                 Identifier = TBI_BOLD;
                 HelpID = HID_PPROPERTYPANEL_TEXT_TBI_BOLD;
+                Command = ".uno:Bold";
             };
             ToolBoxItem
             {
                 Identifier = TBI_ITALIC;
                 HelpID = HID_PPROPERTYPANEL_TEXT_TBI_ITALIC;
+                Command = ".uno:Italic";
             };
             ToolBoxItem
             {
                 Identifier = TBI_UNDERLINE;
                 DropDown = TRUE ;
                 HelpID = HID_PPROPERTYPANEL_TEXT_TBI_UNDERLINE;
+                Command = ".uno:Underline";
             };
             ToolBoxItem
             {
                 Identifier = TBI_STRIKEOUT;
                 HelpID = HID_PPROPERTYPANEL_TEXT_TBI_STRIKEOUT;
+                Command = ".uno:Strikeout";
             };
             ToolBoxItem
             {
                 Identifier = TBI_SHADOWED;
                 HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SHADOWED;
+                Command = ".uno:Shadowed";
             };
         };
     };
@@ -152,6 +161,7 @@ Control RID_SIDEBAR_TEXT_PANEL
                 Identifier = TBI_FONTCOLOR ;
                 HelpID = HID_PPROPERTYPANEL_TEXT_TBI_FONT_COLOR;
                 DropDown = TRUE ;
+                Command = ".uno:Color";
             };
         };
     };
@@ -171,6 +181,7 @@ Control RID_SIDEBAR_TEXT_PANEL
                 Identifier = TBI_HIGHLIGHT ;
                 HelpID = HID_PPROPERTYPANEL_TEXT_TBI_HIGHLIGHT_COLOR;
                 DropDown = TRUE ;
+                Command = ".uno:CharacterBackgroundPattern";
             };
         };
     };
@@ -189,11 +200,13 @@ Control RID_SIDEBAR_TEXT_PANEL
             {
                 Identifier = TBI_SUPER_SW;
                 HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SUPER_SW;
+                Command = ".uno:SuperScript";
             };
             ToolBoxItem
             {
                 Identifier = TBI_SUB_SW;
                 HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SUB_SW;
+                Command = ".uno:SubScript";
             };
         };
     };
@@ -211,11 +224,13 @@ Control RID_SIDEBAR_TEXT_PANEL
             {
                 Identifier = TBI_SUPER;
                 HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SUPER;
+                Command = ".uno:SuperScript";
             };
             ToolBoxItem
             {
                 Identifier = TBI_SUB;
                 HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SUB;
+                Command = ".uno:SubScript";
             };
         };
     };
@@ -235,6 +250,7 @@ Control RID_SIDEBAR_TEXT_PANEL
                 Identifier = TBI_SPACING;
                 DropDown = TRUE ;
                 HelpID = HID_TBI_SPACING;
+                Command = ".uno:Spacing";
             };
         };
     };
commit 144eb666b72516ef78c15424087800dff1be5cfd
Author: Armin Le Grand <alg at apache.org>
Date:   Fri May 10 08:48:11 2013 +0000

    i110384 added better fat line rendering where possible

diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx
index 0366e0f..3caae61 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx
@@ -29,6 +29,15 @@
 #include <vcl/outdev.hxx>
 
 //////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace drawinglayer { namespace primitive2d {
+    class PolyPolygonColorPrimitive2D;
+    class PolygonHairlinePrimitive2D;
+    class PolygonStrokePrimitive2D;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
 
 namespace drawinglayer
 {
@@ -49,6 +58,11 @@ namespace drawinglayer
              */
             virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
 
+            // some helpers to try direct paints (shortcuts)
+            bool tryDrawPolyPolygonColorPrimitive2DDirect(const drawinglayer::primitive2d::PolyPolygonColorPrimitive2D& rSource, double fTransparency);
+            bool tryDrawPolygonHairlinePrimitive2DDirect(const drawinglayer::primitive2d::PolygonHairlinePrimitive2D& rSource, double fTransparency);
+            bool tryDrawPolygonStrokePrimitive2DDirect(const drawinglayer::primitive2d::PolygonStrokePrimitive2D& rSource, double fTransparency);
+
         public:
             /// constructor/destructor
             VclPixelProcessor2D(
diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
index eae8247..bc8a11a 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
@@ -41,7 +41,6 @@ namespace drawinglayer { namespace primitive2d {
     class FillGraphicPrimitive2D;
     class PolyPolygonGradientPrimitive2D;
     class PolyPolygonGraphicPrimitive2D;
-    class PolyPolygonColorPrimitive2D;
     class MetafilePrimitive2D;
     class MaskPrimitive2D;
     class UnifiedTransparencePrimitive2D;
@@ -98,7 +97,6 @@ namespace drawinglayer
             void RenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate);
             void RenderFillGraphicPrimitive2D(const primitive2d::FillGraphicPrimitive2D& rFillBitmapCandidate);
             void RenderPolyPolygonGraphicPrimitive2D(const primitive2d::PolyPolygonGraphicPrimitive2D& rPolygonCandidate);
-            void RenderPolyPolygonColorPrimitive2D(const primitive2d::PolyPolygonColorPrimitive2D& rPolygonCandidate);
             void RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive2D& rMaskCandidate);
             void RenderModifiedColorPrimitive2D(const primitive2d::ModifiedColorPrimitive2D& rModifiedCandidate);
             void RenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rTransCandidate);
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 914d45e..0dd8466 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -99,6 +99,141 @@ namespace drawinglayer
             mpOutputDevice->SetAntialiasing(mpOutputDevice->GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW);
         }
 
+        bool VclPixelProcessor2D::tryDrawPolyPolygonColorPrimitive2DDirect(const drawinglayer::primitive2d::PolyPolygonColorPrimitive2D& rSource, double fTransparency)
+        {
+            basegfx::B2DPolyPolygon aLocalPolyPolygon(rSource.getB2DPolyPolygon());
+
+            if(!aLocalPolyPolygon.count())
+            {
+                // no geometry, done
+                return true;
+            }
+
+            const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(rSource.getBColor()));
+
+            mpOutputDevice->SetFillColor(Color(aPolygonColor));
+            mpOutputDevice->SetLineColor();
+            aLocalPolyPolygon.transform(maCurrentTransformation);
+            mpOutputDevice->DrawTransparent(
+                aLocalPolyPolygon,
+                fTransparency);
+
+            return true;
+        }
+
+        bool VclPixelProcessor2D::tryDrawPolygonHairlinePrimitive2DDirect(const drawinglayer::primitive2d::PolygonHairlinePrimitive2D& rSource, double fTransparency)
+        {
+            basegfx::B2DPolygon aLocalPolygon(rSource.getB2DPolygon());
+
+            if(!aLocalPolygon.count())
+            {
+                // no geometry, done
+                return true;
+            }
+
+            const basegfx::BColor aLineColor(maBColorModifierStack.getModifiedColor(rSource.getBColor()));
+
+            mpOutputDevice->SetFillColor();
+            mpOutputDevice->SetLineColor(Color(aLineColor));
+            aLocalPolygon.transform(maCurrentTransformation);
+
+            // try drawing; if it did not work, use standard fallback
+            if(mpOutputDevice->TryDrawPolyLineDirect(
+                aLocalPolygon,
+                0.0,
+                fTransparency))
+            {
+                return true;
+            }
+
+            return false;
+        }
+
+        bool VclPixelProcessor2D::tryDrawPolygonStrokePrimitive2DDirect(const drawinglayer::primitive2d::PolygonStrokePrimitive2D& rSource, double fTransparency)
+        {
+            basegfx::B2DPolygon aLocalPolygon(rSource.getB2DPolygon());
+
+            if(!aLocalPolygon.count())
+            {
+                // no geometry, done
+                return true;
+            }
+
+            aLocalPolygon = basegfx::tools::simplifyCurveSegments(aLocalPolygon);
+            basegfx::B2DPolyPolygon aHairLinePolyPolygon;
+
+            if(rSource.getStrokeAttribute().isDefault() || 0.0 == rSource.getStrokeAttribute().getFullDotDashLen())
+            {
+                // no line dashing, just copy
+                aHairLinePolyPolygon.append(aLocalPolygon);
+            }
+            else
+            {
+                // apply LineStyle
+                basegfx::tools::applyLineDashing(
+                    aLocalPolygon,
+                    rSource.getStrokeAttribute().getDotDashArray(),
+                    &aHairLinePolyPolygon,
+                    0,
+                    rSource.getStrokeAttribute().getFullDotDashLen());
+            }
+
+            if(!aHairLinePolyPolygon.count())
+            {
+                // no geometry, done
+                return true;
+            }
+
+            const basegfx::BColor aLineColor(
+                maBColorModifierStack.getModifiedColor(
+                    rSource.getLineAttribute().getColor()));
+
+            mpOutputDevice->SetFillColor();
+            mpOutputDevice->SetLineColor(Color(aLineColor));
+            aHairLinePolyPolygon.transform(maCurrentTransformation);
+
+            double fLineWidth(rSource.getLineAttribute().getWidth());
+
+            if(basegfx::fTools::more(fLineWidth, 0.0))
+            {
+                basegfx::B2DVector aLineWidth(fLineWidth, 0.0);
+
+                aLineWidth = maCurrentTransformation * aLineWidth;
+                fLineWidth = aLineWidth.getLength();
+            }
+
+            bool bHasPoints(false);
+            bool bTryWorked(false);
+
+            for(sal_uInt32 a(0); a < aHairLinePolyPolygon.count(); a++)
+            {
+                const basegfx::B2DPolygon aSingle(aHairLinePolyPolygon.getB2DPolygon(a));
+
+                if(aSingle.count())
+                {
+                    bHasPoints = true;
+
+                    if(mpOutputDevice->TryDrawPolyLineDirect(
+                        aSingle,
+                        fLineWidth,
+                        fTransparency,
+                        rSource.getLineAttribute().getLineJoin(),
+                        rSource.getLineAttribute().getLineCap()))
+                    {
+                        bTryWorked = true;
+                    }
+                }
+            }
+
+            if(!bTryWorked && !bHasPoints)
+            {
+                // no geometry despite try
+                bTryWorked = true;
+            }
+
+            return bTryWorked;
+        }
+
         void VclPixelProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate)
         {
             switch(rCandidate.getPrimitive2DID())
@@ -176,8 +311,17 @@ namespace drawinglayer
                 }
                 case PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D :
                 {
+                    // try to use directly
+                    const primitive2d::PolygonHairlinePrimitive2D& rPolygonHairlinePrimitive2D = static_cast< const primitive2d::PolygonHairlinePrimitive2D& >(rCandidate);
+                    static bool bAllowed(true);
+
+                    if(bAllowed && tryDrawPolygonHairlinePrimitive2DDirect(rPolygonHairlinePrimitive2D, 0.0))
+                    {
+                        break;
+                    }
+
                     // direct draw of hairline
-                    RenderPolygonHairlinePrimitive2D(static_cast< const primitive2d::PolygonHairlinePrimitive2D& >(rCandidate), true);
+                    RenderPolygonHairlinePrimitive2D(rPolygonHairlinePrimitive2D, true);
                     break;
                 }
                 case PRIMITIVE2D_ID_BITMAPPRIMITIVE2D :
@@ -247,8 +391,53 @@ namespace drawinglayer
                 }
                 case PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D :
                 {
-                    // direct draw of PolyPolygon with color
-                    RenderPolyPolygonColorPrimitive2D(static_cast< const primitive2d::PolyPolygonColorPrimitive2D& >(rCandidate));
+                    // try to use directly
+                    const primitive2d::PolyPolygonColorPrimitive2D& rPolyPolygonColorPrimitive2D = static_cast< const primitive2d::PolyPolygonColorPrimitive2D& >(rCandidate);
+                    basegfx::B2DPolyPolygon aLocalPolyPolygon;
+                    static bool bAllowed(true);
+
+                    if(bAllowed && tryDrawPolyPolygonColorPrimitive2DDirect(rPolyPolygonColorPrimitive2D, 0.0))
+                    {
+                        // okay, done. In this case no gaps should have to be repaired, too
+                    }
+                    else
+                    {
+                        // direct draw of PolyPolygon with color
+                        const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(rPolyPolygonColorPrimitive2D.getBColor()));
+
+                        mpOutputDevice->SetFillColor(Color(aPolygonColor));
+                        mpOutputDevice->SetLineColor();
+                        aLocalPolyPolygon = rPolyPolygonColorPrimitive2D.getB2DPolyPolygon();
+                        aLocalPolyPolygon.transform(maCurrentTransformation);
+                        mpOutputDevice->DrawPolyPolygon(aLocalPolyPolygon);
+                    }
+
+                    // when AA is on and this filled polygons are the result of stroked line geometry,
+                    // draw the geometry once extra as lines to avoid AA 'gaps' between partial polygons
+                    // Caution: This is needed in both cases (!)
+                    if(mnPolygonStrokePrimitive2D
+                        && getOptionsDrawinglayer().IsAntiAliasing()
+                        && (mpOutputDevice->GetAntialiasing() & ANTIALIASING_ENABLE_B2DDRAW))
+                    {
+                        const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(rPolyPolygonColorPrimitive2D.getBColor()));
+                        sal_uInt32 nCount(aLocalPolyPolygon.count());
+
+                        if(!nCount)
+                        {
+                            aLocalPolyPolygon = rPolyPolygonColorPrimitive2D.getB2DPolyPolygon();
+                            aLocalPolyPolygon.transform(maCurrentTransformation);
+                            nCount = aLocalPolyPolygon.count();
+                        }
+
+                        mpOutputDevice->SetFillColor();
+                        mpOutputDevice->SetLineColor(Color(aPolygonColor));
+
+                        for(sal_uInt32 a(0); a < nCount; a++)
+                        {
+                            mpOutputDevice->DrawPolyLine(aLocalPolyPolygon.getB2DPolygon(a), 0.0);
+                        }
+                    }
+
                     break;
                 }
                 case PRIMITIVE2D_ID_METAFILEPRIMITIVE2D :
@@ -320,25 +509,41 @@ namespace drawinglayer
                                             // single transparent PolyPolygon identified, use directly
                                             const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = static_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(pBasePrimitive);
                                             OSL_ENSURE(pPoPoColor, "OOps, PrimitiveID and PrimitiveType do not match (!)");
-                                            const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor()));
-                                            mpOutputDevice->SetFillColor(Color(aPolygonColor));
-                                            mpOutputDevice->SetLineColor();
-
-                                            basegfx::B2DPolyPolygon aLocalPolyPolygon(pPoPoColor->getB2DPolyPolygon());
-                                            aLocalPolyPolygon.transform(maCurrentTransformation);
-
-                                            mpOutputDevice->DrawTransparent(aLocalPolyPolygon, rUniTransparenceCandidate.getTransparence());
-                                            bDrawTransparentUsed = true;
+                                            bDrawTransparentUsed = tryDrawPolyPolygonColorPrimitive2DDirect(*pPoPoColor, rUniTransparenceCandidate.getTransparence());
+                                            break;
+                                        }
+                                        case PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D:
+                                        {
+                                            // single transparent PolygonHairlinePrimitive2D identified, use directly
+                                            const primitive2d::PolygonHairlinePrimitive2D* pPoHair = static_cast< const primitive2d::PolygonHairlinePrimitive2D* >(pBasePrimitive);
+                                            OSL_ENSURE(pPoHair, "OOps, PrimitiveID and PrimitiveType do not match (!)");
+
+                                            // do no tallow by default - problem is that self-overlapping parts of this geometry will
+                                            // not be in a all-same transparency but will already alpha-cover themselves with blending.
+                                            // This is not what the UnifiedTransparencePrimitive2D defines: It requires all it's
+                                            // content to be uniformely transparent.
+                                            // For hairline the effect is pretty minimal, but still not correct.
+                                            static bool bAllowed(false);
+
+                                            bDrawTransparentUsed = bAllowed && tryDrawPolygonHairlinePrimitive2DDirect(*pPoHair, rUniTransparenceCandidate.getTransparence());
+                                            break;
+                                        }
+                                        case PRIMITIVE2D_ID_POLYGONSTROKEPRIMITIVE2D:
+                                        {
+                                            // single transparent PolygonStrokePrimitive2D identified, use directly
+                                            const primitive2d::PolygonStrokePrimitive2D* pPoStroke = static_cast< const primitive2d::PolygonStrokePrimitive2D* >(pBasePrimitive);
+                                            OSL_ENSURE(pPoStroke, "OOps, PrimitiveID and PrimitiveType do not match (!)");
+
+                                            // do no tallow by default - problem is that self-overlapping parts of this geometry will
+                                            // not be in a all-same transparency but will already alpha-cover themselves with blending.
+                                            // This is not what the UnifiedTransparencePrimitive2D defines: It requires all it's
+                                            // content to be uniformely transparent.
+                                            // To check, acitvate and draw a wide transparent self-crossing line/curve
+                                            static bool bAllowed(false);
+
+                                            bDrawTransparentUsed = bAllowed && tryDrawPolygonStrokePrimitive2DDirect(*pPoStroke, rUniTransparenceCandidate.getTransparence());
                                             break;
                                         }
-                                        // #i# need to wait for #i101378# which is in CWS vcl112 to directly paint transparent hairlines
-                                        //case PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D:
-                                        //{
-                                        //  // single transparent PolygonHairlinePrimitive2D identified, use directly
-                                        //  const primitive2d::PolygonHairlinePrimitive2D* pPoHair = static_cast< const primitive2d::PolygonHairlinePrimitive2D* >(pBasePrimitive);
-                                        //  OSL_ENSURE(pPoHair, "OOps, PrimitiveID and PrimitiveType do not match (!)");
-                                        //  break;
-                                        //}
                                     }
                                 }
                             }
@@ -438,6 +643,14 @@ namespace drawinglayer
                 }
                 case PRIMITIVE2D_ID_POLYGONSTROKEPRIMITIVE2D:
                 {
+                    // try to use directly
+                    const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokePrimitive2D = static_cast< const primitive2d::PolygonStrokePrimitive2D& >(rCandidate);
+
+                    if(tryDrawPolygonStrokePrimitive2DDirect(rPolygonStrokePrimitive2D, 0.0))
+                    {
+                        break;
+                    }
+
                     // the stroke primitive may be decomposed to filled polygons. To keep
                     // evtl. set DrawModes aka DRAWMODE_BLACKLINE, DRAWMODE_GRAYLINE,
                     // DRAWMODE_GHOSTEDLINE, DRAWMODE_WHITELINE or DRAWMODE_SETTINGSLINE
@@ -466,9 +679,7 @@ namespace drawinglayer
                         // as filled polygons is geometrically corret but looks wrong since polygon filling avoids
                         // the right and bottom pixels. The used method evaluates that and takes the correct action,
                         // including calling recursively with decomposition if line is wide enough
-                        const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokePrimitive = static_cast< const primitive2d::PolygonStrokePrimitive2D& >(rCandidate);
-
-                        RenderPolygonStrokePrimitive2D(rPolygonStrokePrimitive);
+                        RenderPolygonStrokePrimitive2D(rPolygonStrokePrimitive2D);
                     }
 
                     // restore DrawMode
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index a525d30..ea51d51 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -756,86 +756,6 @@ namespace drawinglayer
             }
         }
 
-        // direct draw of PolyPolygon with color
-        void VclProcessor2D::RenderPolyPolygonColorPrimitive2D(const primitive2d::PolyPolygonColorPrimitive2D& rPolygonCandidate)
-        {
-            const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(rPolygonCandidate.getBColor()));
-            mpOutputDevice->SetFillColor(Color(aPolygonColor));
-            mpOutputDevice->SetLineColor();
-
-            basegfx::B2DPolyPolygon aLocalPolyPolygon(rPolygonCandidate.getB2DPolyPolygon());
-            aLocalPolyPolygon.transform(maCurrentTransformation);
-
-            static bool bCheckTrapezoidDecomposition(false);
-            static bool bShowOutlinesThere(false);
-            if(bCheckTrapezoidDecomposition)
-            {
-                // clip against discrete ViewPort
-                const basegfx::B2DRange& rDiscreteViewport = getViewInformation2D().getDiscreteViewport();
-                aLocalPolyPolygon = basegfx::tools::clipPolyPolygonOnRange(
-                    aLocalPolyPolygon, rDiscreteViewport, true, false);
-
-                if(aLocalPolyPolygon.count())
-                {
-                    // subdivide
-                    aLocalPolyPolygon = basegfx::tools::adaptiveSubdivideByDistance(
-                        aLocalPolyPolygon, 0.5);
-
-                    // trapezoidize
-                    basegfx::B2DTrapezoidVector aB2DTrapezoidVector;
-                    basegfx::tools::trapezoidSubdivide(aB2DTrapezoidVector, aLocalPolyPolygon);
-
-                    const sal_uInt32 nCount(aB2DTrapezoidVector.size());
-
-                    if(nCount)
-                    {
-                        basegfx::BColor aInvPolygonColor(aPolygonColor);
-                        aInvPolygonColor.invert();
-
-                        for(sal_uInt32 a(0); a < nCount; a++)
-                        {
-                            const basegfx::B2DPolygon aTempPolygon(aB2DTrapezoidVector[a].getB2DPolygon());
-
-                            if(bShowOutlinesThere)
-                            {
-                                mpOutputDevice->SetFillColor(Color(aPolygonColor));
-                                mpOutputDevice->SetLineColor();
-                            }
-
-                            mpOutputDevice->DrawPolygon(aTempPolygon);
-
-                            if(bShowOutlinesThere)
-                            {
-                                mpOutputDevice->SetFillColor();
-                                mpOutputDevice->SetLineColor(Color(aInvPolygonColor));
-                                mpOutputDevice->DrawPolyLine(aTempPolygon, 0.0);
-                            }
-                        }
-                    }
-                }
-            }
-            else
-            {
-                mpOutputDevice->DrawPolyPolygon(aLocalPolyPolygon);
-
-                if(mnPolygonStrokePrimitive2D
-                    && getOptionsDrawinglayer().IsAntiAliasing()
-                    && (mpOutputDevice->GetAntialiasing() & ANTIALIASING_ENABLE_B2DDRAW))
-                {
-                    // when AA is on and this filled polygons are the result of stroked line geometry,
-                    // draw the geometry once extra as lines to avoid AA 'gaps' between partial polygons
-                    mpOutputDevice->SetFillColor();
-                    mpOutputDevice->SetLineColor(Color(aPolygonColor));
-                    const sal_uInt32 nCount(aLocalPolyPolygon.count());
-
-                    for(sal_uInt32 a(0); a < nCount; a++)
-                    {
-                        mpOutputDevice->DrawPolyLine(aLocalPolyPolygon.getB2DPolygon(a), 0.0);
-                    }
-                }
-            }
-        }
-
         // mask group. Force output to VDev and create mask from given mask
         void VclProcessor2D::RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive2D& rMaskCandidate)
         {
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index 8161fc6..7c413fe 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -562,6 +562,7 @@ public:
     SAL_DLLPRIVATE bool ImpTryDrawPolyLineDirect(
         const basegfx::B2DPolygon& rB2DPolygon,
         double fLineWidth = 0.0,
+        double fTransparency = 0.0,
         basegfx::B2DLineJoin eLineJoin = basegfx::B2DLINEJOIN_NONE,
         com::sun::star::drawing::LineCap eLineCap = com::sun::star::drawing::LineCap_BUTT);
 
@@ -699,6 +700,12 @@ public:
         double fLineWidth = 0.0,
         basegfx::B2DLineJoin = basegfx::B2DLINEJOIN_ROUND,
         com::sun::star::drawing::LineCap = com::sun::star::drawing::LineCap_BUTT);
+    bool TryDrawPolyLineDirect(
+        const basegfx::B2DPolygon& rB2DPolygon,
+        double fLineWidth = 0.0,
+        double fTransparency = 0.0,
+        basegfx::B2DLineJoin eLineJoin = basegfx::B2DLINEJOIN_NONE,
+        com::sun::star::drawing::LineCap eLineCap = com::sun::star::drawing::LineCap_BUTT);
 
     /** Render the given polygon as a line stroke
 
diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx
index 4e88430..3849c99 100644
--- a/vcl/source/gdi/outdev.cxx
+++ b/vcl/source/gdi/outdev.cxx
@@ -2260,6 +2260,7 @@ void OutputDevice::ImpDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyPo
 bool OutputDevice::ImpTryDrawPolyLineDirect(
     const basegfx::B2DPolygon& rB2DPolygon,
     double fLineWidth,
+    double fTransparency,
     basegfx::B2DLineJoin eLineJoin,
     com::sun::star::drawing::LineCap eLineCap)
 {
@@ -2289,13 +2290,64 @@ bool OutputDevice::ImpTryDrawPolyLineDirect(
     // draw the polyline
     return mpGraphics->DrawPolyLine(
         aB2DPolygon,
-        0.0,
+        fTransparency,
         aB2DLineWidth,
         eLineJoin,
         eLineCap,
         this);
 }
 
+bool OutputDevice::TryDrawPolyLineDirect(
+    const basegfx::B2DPolygon& rB2DPolygon,
+    double fLineWidth,
+    double fTransparency,
+    basegfx::B2DLineJoin eLineJoin,
+    com::sun::star::drawing::LineCap eLineCap)
+{
+    // AW: Do NOT paint empty PolyPolygons
+    if(!rB2DPolygon.count())
+        return true;
+
+    // we need a graphics
+    if( !mpGraphics )
+        if( !ImplGetGraphics() )
+            return false;
+
+    if( mbInitClipRegion )
+        ImplInitClipRegion();
+
+    if( mbOutputClipped )
+        return true;
+
+    if( mbInitLineColor )
+        ImplInitLineColor();
+
+    const bool bTryAA((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
+        && mpGraphics->supportsOperation(OutDevSupport_B2DDraw)
+        && ROP_OVERPAINT == GetRasterOp()
+        && IsLineColor());
+
+    if(bTryAA)
+    {
+        if(ImpTryDrawPolyLineDirect(rB2DPolygon, fLineWidth, fTransparency, eLineJoin, eLineCap))
+        {
+            // worked, add metafile action (if recorded) and return true
+            if( mpMetaFile )
+            {
+                LineInfo aLineInfo;
+                if( fLineWidth != 0.0 )
+                    aLineInfo.SetWidth( static_cast<long>(fLineWidth+0.5) );
+                const Polygon aToolsPolygon( rB2DPolygon );
+                mpMetaFile->AddAction( new MetaPolyLineAction( aToolsPolygon, aLineInfo ) );
+            }
+
+            return true;
+        }
+    }
+
+    return false;
+}
+
 void OutputDevice::DrawPolyLine(
     const basegfx::B2DPolygon& rB2DPolygon,
     double fLineWidth,
@@ -2304,8 +2356,6 @@ void OutputDevice::DrawPolyLine(
 {
     DBG_TRACE( "OutputDevice::DrawPolyLine(B2D&)" );
     DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
-    (void)eLineJoin; // ATM used in UNX, but not in WNT, access it for warning-free
-    (void)eLineCap;
 
 #if 0 // MetaB2DPolyLineAction is not implemented yet:
       // according to AW adding it is very dangerous since there is a lot
@@ -2347,7 +2397,7 @@ void OutputDevice::DrawPolyLine(
         && IsLineColor());
 
     // use b2dpolygon drawing if possible
-    if(bTryAA && ImpTryDrawPolyLineDirect(rB2DPolygon, fLineWidth, eLineJoin, eLineCap))
+    if(bTryAA && ImpTryDrawPolyLineDirect(rB2DPolygon, fLineWidth, 0.0, eLineJoin, eLineCap))
     {
         return;
     }


More information about the Libreoffice-commits mailing list