[Libreoffice-commits] core.git: Branch 'private/jmux/kde4-vcl-5-0-fix' - 13 commits - cui/source dtrans/source include/sal include/sot include/svx officecfg/registry sc/sdi sc/source sd/sdi sd/source sot/source starmath/inc starmath/sdi starmath/source starmath/uiconfig stoc/source svx/Library_svx.mk svx/sdi svx/source svx/uiconfig svx/UIConfig_svx.mk sw/inc translations vcl/source vcl/unx

Jan-Marek Glogowski glogow at fbihome.de
Wed Jul 8 11:31:30 PDT 2015


Rebased ref, commits from common ancestor:
commit eb25920fa93a3b3c454c74d88c29f7d46a17eefd
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Wed Jul 8 18:02:00 2015 +0000

    tdf#92115 KDE4: better listbox theming
    
    I realized most combo boxes are list boxes, as their entries
    aren't editable.
    
    Change-Id: Ic83b8209208fddafe34e04f4e5e531f0d28e62bd

diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index 55524da..985969e 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -418,24 +418,21 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
     }
     else if (type == CTRL_LISTBOX)
     {
-        if( part == PART_WINDOW )
-        {
-            lcl_drawFrame( QStyle::PE_Frame, m_image,
-                           vclStateValue2StateFlag(nControlState, value) );
-        }
-        else
-        {
-            QStyleOptionComboBox option;
-            if (part == PART_SUB_EDIT)
-            {
+        QStyleOptionComboBox option;
+        switch (part) {
+            case PART_SUB_EDIT:
                 draw( QStyle::CE_ComboBoxLabel, &option, m_image,
                       vclStateValue2StateFlag(nControlState, value) );
-            }
-            else
-            {
+                break;
+            case PART_ENTIRE_CONTROL:
                 draw( QStyle::CC_ComboBox, &option, m_image,
                       vclStateValue2StateFlag(nControlState, value) );
-            }
+                break;
+            case PART_BUTTON_DOWN:
+                option.subControls = QStyle::SC_ComboBoxArrow;
+                draw( QStyle::CC_ComboBox, &option, m_image,
+                      vclStateValue2StateFlag(nControlState, value) );
+                break;
         }
     }
     else if (type == CTRL_LISTNODE)
@@ -653,6 +650,12 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
                                              const OUString&,
                                              Rectangle &nativeBoundingRegion, Rectangle &nativeContentRegion )
 {
+    bool nativeSupport = IsNativeControlSupported( type, part );
+    if( ! nativeSupport ) {
+        assert( ! nativeSupport && "drawNativeControl called without native support!" );
+        return false;
+    }
+
     bool retVal = false;
 
     QRect boundingRect = region2QRect( controlRegion );
@@ -734,8 +737,6 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
             {
                 case PART_ENTIRE_CONTROL:
                 {
-                    int size = QApplication::style()->pixelMetric(QStyle::PM_ComboBoxFrameWidth) - 2;
-
                     // find out the minimum size that should be used
                     // assume contents is a text ling
                     int nHeight = QApplication::fontMetrics().height();
@@ -748,8 +749,10 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
                     // FIXME: why this difference between comboboxes and listboxes ?
                     // because a combobox has a sub edit and that is positioned
                     // inside the outer bordered control ?
-                    if( type == CTRL_COMBOBOX )
+                    if( type == CTRL_COMBOBOX ) {
+                        int size = QApplication::style()->pixelMetric(QStyle::PM_ComboBoxFrameWidth) - 2;
                         contentRect.adjust(-size,-size,size,size);
+                    }
                     retVal = true;
                     break;
                 }
@@ -762,13 +765,22 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
                     retVal = true;
                     break;
                 case PART_SUB_EDIT:
+                {
                     contentRect = QApplication::style()->subControlRect(
                         QStyle::CC_ComboBox, &cbo, QStyle::SC_ComboBoxEditField );
 
-                    contentRect.translate( boundingRect.left(), boundingRect.top() );
+                    int hmargin = QApplication::style()->pixelMetric(
+                            QStyle::PM_FocusFrameHMargin, &styleOption);
+                    int vmargin = QApplication::style()->pixelMetric(
+                            QStyle::PM_FocusFrameVMargin, &styleOption);
+
+                    contentRect.translate( boundingRect.left() + hmargin, boundingRect.top() + vmargin );
+                    contentRect.adjust( 0, 0, -2 * hmargin, -2 * vmargin );
+                    boundingRect = contentRect;
 
                     retVal = true;
                     break;
+                }
                 case PART_WINDOW:
                     retVal = true;
                     break;
commit bc7761f27661ea64920258445fff6d83e9e9983b
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Wed Jul 8 17:59:14 2015 +0000

    KDE4: Switch default image color to transparent
    
    Just fill the image _once_ at the beginning.
    
    Change-Id: I39c03b2ca779381920e2597b4bea7973fea6ae2a

diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index a843269..55524da 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -244,13 +244,28 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
                               widgetRect.height(),
                               QImage::Format_ARGB32 );
     }
-    m_image->fill(KApplication::palette().color(QPalette::Window).rgb());
+
+    // Default image color
+    switch (type)
+    {
+        case CTRL_MENUBAR:
+        case CTRL_MENU_POPUP:
+        case CTRL_WINDOW_BACKGROUND:
+            m_image->fill( KApplication::palette().color(QPalette::Window).rgb() );
+            break;
+        case CTRL_SCROLLBAR:
+            if ((part == PART_DRAW_BACKGROUND_VERT) || (part == PART_DRAW_BACKGROUND_HORZ))
+                m_image->fill( KApplication::palette().color(QPalette::Window).rgb() );
+            break;
+        default:
+            m_image->fill( Qt::transparent );
+            break;
+    }
 
     QRegion* clipRegion = NULL;
 
     if (type == CTRL_PUSHBUTTON)
     {
-        m_image->fill( Qt::transparent );
         QStyleOptionButton option;
         draw( QStyle::CE_PushButton, &option, m_image,
               vclStateValue2StateFlag(nControlState, value) );
@@ -333,7 +348,6 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
             QRect menuItemRect( region2QRect( menuVal->maItemRect ));
             QRect rect( menuItemRect.topLeft() - widgetRect.topLeft(),
                 widgetRect.size().expandedTo( menuItemRect.size()));
-            m_image->fill( Qt::transparent );
             draw( QStyle::CE_MenuItem, &option, m_image,
                   vclStateValue2StateFlag(nControlState, value), rect );
         }
@@ -352,7 +366,6 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
     }
     else if ( (type == CTRL_TOOLBAR) && (part == PART_BUTTON) )
     {
-        m_image->fill( Qt::transparent );
         QStyleOptionToolButton option;
 
         option.arrowType = Qt::NoArrow;
@@ -427,7 +440,6 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
     }
     else if (type == CTRL_LISTNODE)
     {
-        m_image->fill( Qt::transparent );
         QStyleOption option;
         option.state = QStyle::State_Item | QStyle::State_Children;
 
@@ -439,7 +451,6 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
     }
     else if (type == CTRL_CHECKBOX)
     {
-        m_image->fill( Qt::transparent );
         QStyleOptionButton option;
         draw( QStyle::CE_CheckBox, &option, m_image,
                vclStateValue2StateFlag(nControlState, value) );
@@ -506,7 +517,6 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
     }
     else if (type == CTRL_RADIOBUTTON)
     {
-        m_image->fill( Qt::transparent );
         QStyleOptionButton option;
         draw( QStyle::CE_RadioButton, &option, m_image,
               vclStateValue2StateFlag(nControlState, value) );
@@ -528,7 +538,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
     }
     else if (type == CTRL_WINDOW_BACKGROUND)
     {
-        m_image->fill(KApplication::palette().color(QPalette::Window).rgb());
+        // Nothing to do - see "Default image color" switch ^^
     }
     else if (type == CTRL_FIXEDLINE)
     {
commit d543c4854d12bb6b75b2548136537a4787d258d8
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Wed Jul 8 07:51:57 2015 +0000

    KDE4: cleanup IsNativeControlSupported
    
    Be (more) correct about the widgets and parts, we actually can draw
    natively in KDE4.
    
    Also add an assert, so drawNativeControl won't be called with values
    not supported by IsNativeControlSupported.
    
    Fixes tdf#92110
    Fixes tdf#91808
    
    Change-Id: Iac6c78194191a9cd059ace560c285263ce7c1045

diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index 1fa06fd..a843269 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -85,47 +85,38 @@ KDESalGraphics::~KDESalGraphics()
 
 bool KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart part )
 {
-    if (type == CTRL_PUSHBUTTON) return true;
-
-    if (type == CTRL_MENUBAR) return true;
-
-    if (type == CTRL_MENU_POPUP) return true;
-
-    if (type == CTRL_EDITBOX) return true;
-
-    if (type == CTRL_COMBOBOX) return true;
-
-    if (type == CTRL_TOOLBAR) return true;
-
-    if (type == CTRL_CHECKBOX) return true;
-
-    if (type == CTRL_LISTBOX) return true;
-
-    if (type == CTRL_LISTNODE) return true;
-
-    if (type == CTRL_FRAME) return true;
-
-    if (type == CTRL_SCROLLBAR) return true;
-
-    if (type == CTRL_WINDOW_BACKGROUND) return true;
-
-    if (type == CTRL_SPINBOX && (part == PART_ENTIRE_CONTROL || part == HAS_BACKGROUND_TEXTURE) ) return true;
-
-    // no spinbuttons for KDE, paint spinbox complete
-    //if (type == CTRL_SPINBUTTONS) return true;
-
-    if (type == CTRL_GROUPBOX) return true;
-
-    if (type == CTRL_FIXEDLINE) return true;
+    switch (type)
+    {
+        case CTRL_PUSHBUTTON:
+        case CTRL_RADIOBUTTON:
+        case CTRL_CHECKBOX:
+        case CTRL_TOOLTIP:
+        case CTRL_PROGRESS:
+        case CTRL_LISTNODE:
+            return (part == PART_ENTIRE_CONTROL);
 
-    if (type == CTRL_TOOLTIP) return true;
+        case CTRL_MENUBAR:
+        case CTRL_MENU_POPUP:
+        case CTRL_EDITBOX:
+        case CTRL_COMBOBOX:
+        case CTRL_TOOLBAR:
+        case CTRL_LISTBOX:
+        case CTRL_FRAME:
+        case CTRL_SCROLLBAR:
+        case CTRL_WINDOW_BACKGROUND:
+        case CTRL_GROUPBOX:
+        case CTRL_FIXEDLINE:
+            return true;
 
-    if (type == CTRL_RADIOBUTTON) return true;
+        case CTRL_SPINBOX:
+            return (part == PART_ENTIRE_CONTROL || part == HAS_BACKGROUND_TEXTURE);
 
-    if (type == CTRL_SLIDER && (part == PART_TRACK_HORZ_AREA || part == PART_TRACK_VERT_AREA) )
-        return true;
+        case CTRL_SLIDER:
+            return (part == PART_TRACK_HORZ_AREA || part == PART_TRACK_VERT_AREA);
 
-    if ( (type == CTRL_PROGRESS) && (part == PART_ENTIRE_CONTROL) ) return true;
+        default:
+            break;
+    }
 
     return false;
 }
@@ -221,15 +212,15 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
                                         const ImplControlValue& value,
                                         const OUString& )
 {
-    if( lastPopupRect.isValid() && ( type != CTRL_MENU_POPUP || part != PART_MENU_ITEM ))
-        lastPopupRect = QRect();
-
-    // put not implemented types here
-    if (type == CTRL_SPINBUTTONS)
-    {
+    bool nativeSupport = IsNativeControlSupported( type, part );
+    if( ! nativeSupport ) {
+        assert( ! nativeSupport && "drawNativeControl called without native support!" );
         return false;
     }
 
+    if( lastPopupRect.isValid() && ( type != CTRL_MENU_POPUP || part != PART_MENU_ITEM ))
+        lastPopupRect = QRect();
+
     bool returnVal = true;
 
     QRect widgetRect = region2QRect(rControlRegion);
commit fbf9858a60120a7fc8e1ca4045bbcd6091c614df
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Jul 8 18:40:10 2015 +0200

    Updated core
    Project: translations  5fbe7f221f27df62d1156763f03baa90322c366b
    
    interim typo fix NETTORABEITSTAGE -> NETTOARBEITSTAGE
    
    Misspelled spreadsheet function names are most ugly..
    
    Change-Id: I73a1f611e66a1484d2a728d3339eff5a6cd852ac

diff --git a/translations b/translations
index f7efc4e..5fbe7f2 160000
--- a/translations
+++ b/translations
@@ -1 +1 @@
-Subproject commit f7efc4ecf69cba536cd0391d4673e31226b1fe86
+Subproject commit 5fbe7f221f27df62d1156763f03baa90322c366b
commit 9f1682f4e752c4f9ea43a21d1e201b014a88aca8
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jul 8 18:02:23 2015 +0200

    various warnings
    
    Change-Id: I1e4f6920601bad273b5255defc9377ef303083fc

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 1c4ca54..c5ffc39 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1669,7 +1669,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
                         SfxMedium* pClipboardMedium = new SfxMedium();
                         pClipboardMedium->GetItemSet(); //generate initial itemset, not sure if necessary
                         const SfxFilter* pMathFilter =
-                            SfxFilter::GetFilterByName(OUString::createFromAscii(MATHML_XML));
+                            SfxFilter::GetFilterByName(MATHML_XML);
                         pClipboardMedium->SetFilter(pMathFilter);
                         pClipboardMedium->setStreamToLoadFrom(xStrm, true /*bIsReadOnly*/);
                         InsertFrom(*pClipboardMedium);
@@ -1688,14 +1688,14 @@ void SmViewShell::Execute(SfxRequest& rReq)
                             SfxMedium* pClipboardMedium = new SfxMedium();
                             pClipboardMedium->GetItemSet(); //generates initial itemset, not sure if necessary
                             const SfxFilter* pMathFilter =
-                                SfxFilter::GetFilterByName(OUString::createFromAscii(MATHML_XML));
+                                SfxFilter::GetFilterByName(MATHML_XML);
                             pClipboardMedium->SetFilter(pMathFilter);
 
                             SvMemoryStream * pStrm;
                             // The text to be imported might asserts encoding like 'encoding="utf-8"' but FORMAT_STRING is UTF-16.
                             // Force encoding to UTF-16, if encoding exists.
                             bool bForceUTF16 = false;
-                            sal_Int32 nPosL = aString.indexOf( OUString::createFromAscii("encoding=\""));
+                            sal_Int32 nPosL = aString.indexOf("encoding=\"");
                             sal_Int32 nPosU = -1;
                             if ( nPosL >= 0 && nPosL +10 < aString.getLength() )
                             {
@@ -1708,12 +1708,12 @@ void SmViewShell::Execute(SfxRequest& rReq)
                             }
                             if ( bForceUTF16 )
                             {
-                                OUString aNewString = aString.replaceAt( nPosL,nPosU-nPosL,OUString::createFromAscii("UTF-16"));
-                                pStrm = new SvMemoryStream( (void*)aNewString.getStr(), aNewString.getLength() * sizeof(sal_Unicode), StreamMode::READ);
+                                OUString aNewString = aString.replaceAt( nPosL,nPosU-nPosL,"UTF-16");
+                                pStrm = new SvMemoryStream( const_cast<sal_Unicode *>(aNewString.getStr()), aNewString.getLength() * sizeof(sal_Unicode), StreamMode::READ);
                             }
                             else
                             {
-                                pStrm = new SvMemoryStream( (void*)aString.getStr(), aString.getLength() * sizeof(sal_Unicode), StreamMode::READ);
+                                pStrm = new SvMemoryStream( const_cast<sal_Unicode *>(aString.getStr()), aString.getLength() * sizeof(sal_Unicode), StreamMode::READ);
                             }
                             uno::Reference<io::XInputStream> xStrm2( new ::utl::OInputStreamWrapper(*pStrm) );
                             pClipboardMedium->setStreamToLoadFrom(xStrm2, true /*bIsReadOnly*/);
commit feab17bc3626b5d1585d91ce006b4b9105483c1f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jul 8 17:54:36 2015 +0200

    various warnings
    
    Change-Id: Id3a56d628088f19424bd6e0c8bf23b0ac6c64d25

diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx
index bfb1d0a..a027abc 100644
--- a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx
+++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx
@@ -28,6 +28,35 @@ using namespace css;
 using namespace css::uno;
 using sfx2::sidebar::Theme;
 
+namespace {
+
+sal_uInt32 ParseText(OUString const & sTmp)
+{
+    if (sTmp.isEmpty())
+        return 0;
+    sal_Unicode nChar = sTmp[0];
+    if( nChar == '-' )
+    {
+        if (sTmp.getLength() < 2)
+            return 0;
+        nChar = sTmp[1];
+    }
+
+    if( (nChar < '0') || (nChar > '9') )
+        return 0;
+
+    const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() );
+    const sal_Unicode cSep = rLocaleWrapper.getNumDecimalSep()[0];
+
+    rtl_math_ConversionStatus eStatus;
+    double fTmp = rtl::math::stringToDouble( sTmp, cSep, 0, &eStatus);
+    if (eStatus != rtl_math_ConversionStatus_Ok)
+        return 0;
+
+    return fTmp;
+}
+
+}
 
 namespace svx { namespace sidebar {
 
@@ -171,33 +200,6 @@ IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowDistanceHdl)
     return 0;
 }
 
-sal_uInt32 ShadowPropertyPanel::ParseText(OUString sTmp)
-{
-    if (sTmp.isEmpty())
-        return 0;
-    sal_Unicode nChar = sTmp[0];
-    if( nChar == '-' )
-    {
-        if (sTmp.getLength() < 2)
-            return 0;
-        nChar = sTmp[1];
-    }
-
-    if( (nChar < '0') || (nChar > '9') )
-        return 0;
-
-    const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() );
-    const sal_Unicode cSep = rLocaleWrapper.getNumDecimalSep()[0];
-
-    rtl_math_ConversionStatus eStatus;
-    double fTmp = rtl::math::stringToDouble( sTmp, cSep, 0, &eStatus);
-    if (eStatus != rtl_math_ConversionStatus_Ok)
-        return 0;
-
-    return fTmp;
-
-}
-
 void ShadowPropertyPanel::UpdateControls()
 {
     if(mpShowShadow->GetState() == TRISTATE_FALSE)
diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx b/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx
index c32f327..520e03d 100644
--- a/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx
+++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx
@@ -65,7 +65,6 @@ private:
     VclPtr<Slider>        mpShadowTransSlider;
     VclPtr<MetricField>   mpShadowTransMetric;
     XColorListRef         pColorList;
-    bool bDisabled;
 
     ::sfx2::sidebar::ControllerItem maShadowController;
     ::sfx2::sidebar::ControllerItem maShadowTransController;
@@ -83,7 +82,6 @@ private:
     void InsertAngleValues();
     void SetTransparencyValue(long);
     void UpdateControls();
-    sal_uInt32 ParseText(OUString pStr);
     DECL_LINK(ClickShadowHdl, void*);
     DECL_LINK(ModifyShadowColorHdl, void*);
     DECL_LINK(ModifyShadowTransMetricHdl, void*);
commit cc43153f466135b959605add37ccd9443852c185
Author: Rishabh Kumar <kris.kr296 at gmail.com>
Date:   Fri Jun 19 18:55:43 2015 +0530

    tdf#87702: Addition of Shadow sidebar tab
    
    Change-Id: I75b368c0a8088926c765dbc46c6a4ce7c9d8b9f0
    Reviewed-on: https://gerrit.libreoffice.org/16375
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx
index 67abb5d..dd6db29 100644
--- a/cui/source/tabpages/tpshadow.cxx
+++ b/cui/source/tabpages/tpshadow.cxx
@@ -41,7 +41,10 @@ const sal_uInt16 SvxShadowTabPage::pShadowRanges[] =
     SDRATTR_SHADOWCOLOR,
     SDRATTR_SHADOWTRANSPARENCE,
     SID_ATTR_FILL_SHADOW,
-    SID_ATTR_FILL_SHADOW,
+    SID_ATTR_SHADOW_COLOR,
+    SID_ATTR_SHADOW_TRANSPARENCE,
+    SID_ATTR_SHADOW_XDISTANCE,
+    SID_ATTR_SHADOW_YDISTANCE,
     0
 };
 
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 81cecff..f59e3e4 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -1008,8 +1008,12 @@
 #define SID_PARASPACE_DECREASE                          ( SID_SVX_START + 1146 )
 
 #define SID_OBJECT_CROP                                 ( SID_SVX_START + 1147 )
+#define SID_ATTR_SHADOW_TRANSPARENCE                    ( SID_SVX_START + 1148 )
+#define SID_ATTR_SHADOW_COLOR                           ( SID_SVX_START + 1149 )
+#define SID_ATTR_SHADOW_XDISTANCE                       ( SID_SVX_START + 1150 )
+#define SID_ATTR_SHADOW_YDISTANCE                       ( SID_SVX_START + 1151 )
 
-#define SID_EDIT_POSTIT                                 ( SID_SVX_START + 1148 )
+#define SID_EDIT_POSTIT                                 ( SID_SVX_START + 1152 )
 
 // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
 #define SID_SVX_FIRSTFREE                               (SID_EDIT_POSTIT + 1)
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
index 653d826..e20b1b0 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
@@ -368,6 +368,38 @@
         </prop>
       </node>
 
+      <node oor:name="ShadowPropertyPanel" oor:op="replace">
+        <prop oor:name="Title" oor:type="xs:string">
+          <value xml:lang="en-US">Shadow</value>
+        </prop>
+        <prop oor:name="Id" oor:type="xs:string">
+          <value>ShadowPropertyPanel</value>
+        </prop>
+        <prop oor:name="DeckId" oor:type="xs:string">
+          <value>PropertyDeck</value>
+        </prop>
+        <prop oor:name="DefaultMenuCommand">
+          <value>.uno:FormatArea</value>
+        </prop>
+        <prop oor:name="ContextList">
+          <value oor:separator=";">
+            Calc,           Draw,       visible ;
+            Calc,           OLE,        hidden  ;
+            DrawImpress,    3DObject,   visible ;
+            DrawImpress,    Draw,       visible ;
+            DrawImpress,    Graphic,    hidden  ;
+            DrawImpress,    TextObject, hidden  ;
+            DrawImpress,    OLE,        hidden  ;
+          </value>
+        </prop>
+        <prop oor:name="ImplementationURL" oor:type="xs:string">
+          <value>private:resource/toolpanel/SvxPanelFactory/ShadowPropertyPanel</value>
+        </prop>
+        <prop oor:name="OrderIndex" oor:type="xs:int">
+          <value>300</value>
+        </prop>
+      </node>
+
       <node oor:name="LinePropertyPanel" oor:op="replace">
         <prop oor:name="Title" oor:type="xs:string">
           <value xml:lang="en-US">Line</value>
diff --git a/sc/sdi/drawsh.sdi b/sc/sdi/drawsh.sdi
index d4a1eec..7fb2639 100644
--- a/sc/sdi/drawsh.sdi
+++ b/sc/sdi/drawsh.sdi
@@ -72,6 +72,14 @@ interface TableDraw
         StateMethod = GetDrawAttrState;
         Export = FALSE;
     ]
+    SID_ATTR_SHADOW_COLOR
+    [   ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; Export = FALSE; ]
+    SID_ATTR_SHADOW_TRANSPARENCE
+    [   ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; Export = FALSE; ]
+    SID_ATTR_SHADOW_XDISTANCE
+    [   ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; Export = FALSE; ]
+    SID_ATTR_SHADOW_YDISTANCE
+    [   ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; Export = FALSE; ]
 
     SID_ATTR_FILL_COLOR     [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; Export = FALSE; ]
     SID_ATTR_FILL_GRADIENT  [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; Export = FALSE; ]
diff --git a/sc/source/ui/app/typemap.cxx b/sc/source/ui/app/typemap.cxx
index 171e4c3..e2f0fbf 100644
--- a/sc/source/ui/app/typemap.cxx
+++ b/sc/source/ui/app/typemap.cxx
@@ -96,6 +96,8 @@
 #include <avmedia/mediaitem.hxx>
 #include <sfx2/frame.hxx>
 #include "attrib.hxx"
+#include <svx/sdprcitm.hxx>
+#include <svx/sdmetitm.hxx>
 
 #define SvxDrawToolItem             SfxAllEnumItem
 #define SvxDrawAlignItem            SfxAllEnumItem
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index b1bf529..3958b37 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -147,6 +147,10 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
 
         // #i25616#
         case SID_ATTR_FILL_SHADOW:
+        case SID_ATTR_SHADOW_TRANSPARENCE:
+        case SID_ATTR_SHADOW_COLOR:
+        case SID_ATTR_SHADOW_XDISTANCE:
+        case SID_ATTR_SHADOW_YDISTANCE:
             {
                 // Wenn ToolBar vertikal :
                 if ( !rReq.GetArgs() )
@@ -173,7 +177,10 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
 
                         // #i25616#
                         case SID_ATTR_FILL_SHADOW:
-
+                        case SID_ATTR_SHADOW_TRANSPARENCE:
+                        case SID_ATTR_SHADOW_COLOR:
+                        case SID_ATTR_SHADOW_XDISTANCE:
+                        case SID_ATTR_SHADOW_YDISTANCE:
                             ExecuteAreaDlg( rReq );
                             break;
 
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index 6b2f17c..827bdff 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -1849,6 +1849,26 @@ interface DrawView
         ExecMethod = FuTemporary ;
         StateMethod = GetAttrState ;
     ]
+    SID_ATTR_SHADOW_COLOR
+    [
+        ExecMethod = FuTemporary ;
+        StateMethod = GetAttrState ;
+    ]
+    SID_ATTR_SHADOW_TRANSPARENCE
+    [
+        ExecMethod = FuTemporary ;
+        StateMethod = GetAttrState ;
+    ]
+    SID_ATTR_SHADOW_XDISTANCE
+    [
+        ExecMethod = FuTemporary;
+        StateMethod = GetAttrState;
+    ]
+    SID_ATTR_SHADOW_YDISTANCE
+    [
+        ExecMethod = FuTemporary;
+        StateMethod = GetAttrState;
+    ]
     SID_ATTR_TEXT_FITTOSIZE // ole : no, status : ?
     [
         ExecMethod = FuTemporary ;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 90c3d59..83262d4 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -243,6 +243,10 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
         case SID_ATTR_FILL_HATCH:
         case SID_ATTR_FILL_BITMAP:
         case SID_ATTR_FILL_SHADOW:
+        case SID_ATTR_SHADOW_COLOR:
+        case SID_ATTR_SHADOW_TRANSPARENCE:
+        case SID_ATTR_SHADOW_XDISTANCE:
+        case SID_ATTR_SHADOW_YDISTANCE:
         case SID_ATTR_FILL_TRANSPARENCE:
         case SID_ATTR_FILL_FLOATTRANSPARENCE:
 
@@ -269,6 +273,10 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
                 switch( rReq.GetSlot() )
                 {
                     case SID_ATTR_FILL_SHADOW:
+                    case SID_ATTR_SHADOW_COLOR:
+                    case SID_ATTR_SHADOW_TRANSPARENCE:
+                    case SID_ATTR_SHADOW_XDISTANCE:
+                    case SID_ATTR_SHADOW_YDISTANCE:
                     case SID_ATTR_FILL_STYLE:
                     case SID_ATTR_FILL_COLOR:
                     case SID_ATTR_FILL_GRADIENT:
diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index f92c0f0..aada4c5 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -390,6 +390,10 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
             case SID_ATTR_FILL_HATCH:
             case SID_ATTR_FILL_BITMAP:
             case SID_ATTR_FILL_SHADOW:
+            case SID_ATTR_SHADOW_COLOR:
+            case SID_ATTR_SHADOW_TRANSPARENCE:
+            case SID_ATTR_SHADOW_XDISTANCE:
+            case SID_ATTR_SHADOW_YDISTANCE:
             case SID_ATTR_FILL_TRANSPARENCE:
             case SID_ATTR_FILL_FLOATTRANSPARENCE:
             case SID_ATTR_LINE_STYLE:
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index 7cc76cb..44ea48a 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -189,6 +189,7 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
     svx/source/sidebar/area/AreaPropertyPanel \
     svx/source/sidebar/area/AreaTransparencyGradientControl \
     svx/source/sidebar/area/AreaTransparencyGradientPopup \
+    svx/source/sidebar/shadow/ShadowPropertyPanel \
     svx/source/sidebar/graphic/GraphicPropertyPanel \
     svx/source/sidebar/line/LinePropertyPanel \
     svx/source/sidebar/line/LineWidthControl \
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk
index ba19a9c..650ecf9 100644
--- a/svx/UIConfig_svx.mk
+++ b/svx/UIConfig_svx.mk
@@ -59,6 +59,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
 	svx/uiconfig/ui/redlineviewpage \
 	svx/uiconfig/ui/savemodifieddialog \
 	svx/uiconfig/ui/sidebararea \
+    svx/uiconfig/ui/sidebarshadow \
 	svx/uiconfig/ui/sidebargraphic \
 	svx/uiconfig/ui/sidebarinsert \
 	svx/uiconfig/ui/sidebarline \
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index b301c58..ec3bbec 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -10375,6 +10375,7 @@ SdrOnOffItem FillShadow SID_ATTR_FILL_SHADOW
 
 [
     /* flags: */
+
     AutoUpdate = TRUE,
     Cachable = Cachable,
     FastCall = FALSE,
@@ -10397,6 +10398,113 @@ SdrOnOffItem FillShadow SID_ATTR_FILL_SHADOW
     GroupId = GID_DOCUMENT;
 ]
 
+XColorItem FillShadowColor SID_ATTR_SHADOW_COLOR
+
+[
+    /* flags: */
+
+    AutoUpdate = TRUE,
+    Cachable = Cachable,
+    FastCall = FALSE,
+    HasCoreId = FALSE,
+    HasDialog = FALSE,
+    ReadOnlyDoc = FALSE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+    Synchron;
+
+    Readonly = FALSE,
+
+    /* config: */
+    AccelConfig = FALSE,
+    MenuConfig = FALSE,
+    StatusBarConfig = FALSE,
+    ToolBoxConfig = FALSE,
+    GroupId = GID_DOCUMENT;
+]
+
+SdrPercentItem FillShadowTransparency SID_ATTR_SHADOW_TRANSPARENCE
+
+[
+    /* flags: */
+
+    AutoUpdate = TRUE,
+    Cachable = Cachable,
+    FastCall = FALSE,
+    HasCoreId = FALSE,
+    HasDialog = FALSE,
+    ReadOnlyDoc = FALSE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+    Synchron;
+
+    Readonly = FALSE,
+
+    /* config: */
+    AccelConfig = FALSE,
+    MenuConfig = FALSE,
+    StatusBarConfig = FALSE,
+    ToolBoxConfig = FALSE,
+    GroupId = GID_DOCUMENT;
+]
+
+SdrMetricItem FillShadowXDistance SID_ATTR_SHADOW_XDISTANCE
+
+[
+    /* flags: */
+
+    AutoUpdate = TRUE,
+    Cachable = Cachable,
+    FastCall = FALSE,
+    HasCoreId = FALSE,
+    HasDialog = FALSE,
+    ReadOnlyDoc = FALSE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+    Synchron;
+
+    Readonly = FALSE,
+
+    /* config: */
+    AccelConfig = FALSE,
+    MenuConfig = FALSE,
+    StatusBarConfig = FALSE,
+    ToolBoxConfig = FALSE,
+    GroupId = GID_DOCUMENT;
+]
+
+SdrMetricItem FillShadowYDistance SID_ATTR_SHADOW_YDISTANCE
+
+[
+    /* flags: */
+
+    AutoUpdate = TRUE,
+    Cachable = Cachable,
+    FastCall = FALSE,
+    HasCoreId = FALSE,
+    HasDialog = FALSE,
+    ReadOnlyDoc = FALSE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+    Synchron;
+
+    Readonly = FALSE,
+
+    /* config: */
+    AccelConfig = FALSE,
+    MenuConfig = FALSE,
+    StatusBarConfig = FALSE,
+    ToolBoxConfig = FALSE,
+    GroupId = GID_DOCUMENT;
+]
 
 SvxShadowedItem Shadowed SID_ATTR_CHAR_SHADOWED
 
diff --git a/svx/sdi/svxitems.sdi b/svx/sdi/svxitems.sdi
index 6887062..5664a2b 100644
--- a/svx/sdi/svxitems.sdi
+++ b/svx/sdi/svxitems.sdi
@@ -362,6 +362,9 @@ item String                 SvxBitmapListItem;
 item String                 SfxLockBytesItem;
 item String                 SvxFontListItem;
 item String                 avmedia_MediaItem;
+item INT32                  XColorItem;
+item INT16                  SdrPercentItem;
+item INT32                  SdrMetricItem;
 
 item BYTE                   SfxGlobalNameItem;
 
diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx
index a89b9e0..a1c4798 100644
--- a/svx/source/sidebar/PanelFactory.cxx
+++ b/svx/source/sidebar/PanelFactory.cxx
@@ -21,6 +21,7 @@
 #include "styles/StylesPropertyPanel.hxx"
 #include "paragraph/ParaPropertyPanel.hxx"
 #include "area/AreaPropertyPanel.hxx"
+#include "shadow/ShadowPropertyPanel.hxx"
 #include "graphic/GraphicPropertyPanel.hxx"
 #include "line/LinePropertyPanel.hxx"
 #include "possize/PosSizePropertyPanel.hxx"
@@ -157,6 +158,10 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
     {
         pControl = AreaPropertyPanel::Create(pParentWindow, xFrame, pBindings);
     }
+    else if (rsResourceURL.endsWith("/ShadowPropertyPanel"))
+    {
+        pControl = ShadowPropertyPanel::Create(pParentWindow, xFrame, pBindings);
+    }
     else if (rsResourceURL.endsWith("/GraphicPropertyPanel"))
     {
         pControl = GraphicPropertyPanel::Create(pParentWindow, xFrame, pBindings);
diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx
new file mode 100644
index 0000000..bfb1d0a
--- /dev/null
+++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx
@@ -0,0 +1,383 @@
+#include <ShadowPropertyPanel.hxx>
+#include <comphelper/string.hxx>
+#include <sfx2/sidebar/ControlFactory.hxx>
+#include <sfx2/sidebar/ResourceDefinitions.hrc>
+#include <sfx2/sidebar/Theme.hxx>
+#include <svx/dialogs.hrc>
+#include <svx/dialmgr.hxx>
+#include <sfx2/objsh.hxx>
+#include <sfx2/bindings.hxx>
+#include <sfx2/dispatch.hxx>
+#include <svx/xlineit0.hxx>
+#include <svx/xtable.hxx>
+#include <svtools/valueset.hxx>
+#include <unotools/pathoptions.hxx>
+#include <boost/bind.hpp>
+#include <svx/xattr.hxx>
+#include <svx/svddef.hxx>
+#include <svx/sdooitm.hxx>
+#include <svx/sdshitm.hxx>
+#include <svx/sdshtitm.hxx>
+#include <svx/sdprcitm.hxx>
+#include <svx/sdsxyitm.hxx>
+#include <svx/svdmodel.hxx>
+#include <svx/drawitem.hxx>
+#include <svx/sdshcitm.hxx>
+
+using namespace css;
+using namespace css::uno;
+using sfx2::sidebar::Theme;
+
+
+namespace svx { namespace sidebar {
+
+ShadowPropertyPanel::ShadowPropertyPanel(
+    vcl::Window* pParent,
+    const uno::Reference<frame::XFrame>& rxFrame,
+    SfxBindings* pBindings)
+:   PanelLayout(pParent, "ShadowPropertyPanel", "svx/ui/sidebarshadow.ui", rxFrame),
+    maShadowController(SID_ATTR_FILL_SHADOW, *pBindings, *this),
+    maShadowTransController(SID_ATTR_SHADOW_TRANSPARENCE, *pBindings, *this),
+    maShadowColorController(SID_ATTR_SHADOW_COLOR, *pBindings, *this),
+    maShadowXDistanceController(SID_ATTR_SHADOW_XDISTANCE, *pBindings, *this),
+    maShadowYDistanceController(SID_ATTR_SHADOW_YDISTANCE, *pBindings, *this),
+    mxFrame(rxFrame),
+    mpBindings(pBindings)
+{
+    get(mpShowShadow,"SHOW_SHADOW");
+    get(mpFTAngle,"angle");
+    get(mpShadowAngle,"LB_ANGLE");
+    get(mpFTDistance,"distance");
+    get(mpShadowDistance,"LB_DISTANCE");
+    get(mpFTTransparency,"transparency_label");
+    get(mpShadowTransSlider,"transparency_slider");
+    get(mpShadowTransMetric,"FIELD_TRANSPARENCY");
+    get(mpFTColor,"color");
+    get(mpLBShadowColor,"LB_SHADOW_COLOR");
+
+    Initialize();
+}
+
+ShadowPropertyPanel::~ShadowPropertyPanel()
+{
+    disposeOnce();
+}
+
+void ShadowPropertyPanel::dispose()
+{
+    mpShowShadow.clear();
+    mpFTAngle.clear();
+    mpShadowAngle.clear();
+    mpFTDistance.clear();
+    mpShadowDistance.clear();
+    mpFTTransparency.clear();
+    mpShadowTransSlider.clear();
+    mpShadowTransMetric.clear();
+    mpFTColor.clear();
+    mpLBShadowColor.clear();
+
+    maShadowController.dispose();
+    maShadowTransController.dispose();
+    maShadowColorController.dispose();
+    maShadowXDistanceController.dispose();
+    maShadowYDistanceController.dispose();
+    PanelLayout::dispose();
+}
+
+void ShadowPropertyPanel::Initialize()
+{
+    SfxObjectShell* pDocSh = SfxObjectShell::Current();
+    const SfxPoolItem* pItem = pDocSh->GetItem(SID_COLOR_TABLE);
+    pColorList = static_cast<const SvxColorListItem*>(pItem) ->GetColorList();
+    mpLBShadowColor->Fill(pColorList);
+    mpShowShadow->SetState( TRISTATE_FALSE );
+    Link<> bLink = LINK(this, ShadowPropertyPanel, ClickShadowHdl );
+    mpShowShadow->SetClickHdl( bLink );
+    Link<> aLink = LINK( this, ShadowPropertyPanel, ModifyShadowColorHdl );
+    mpShadowTransMetric->SetMax(100);
+    mpShadowTransMetric->SetModifyHdl( LINK(this, ShadowPropertyPanel, ModifyShadowTransMetricHdl) );
+    mpLBShadowColor->SetSelectHdl( aLink );
+    mpShadowAngle->SetModifyHdl( LINK(this, ShadowPropertyPanel, ModifyShadowDistanceHdl) );
+    mpShadowDistance->SetModifyHdl( LINK(this, ShadowPropertyPanel, ModifyShadowDistanceHdl) );
+    mpShadowTransSlider->SetRange(Range(0,100));
+    mpShadowTransSlider->SetUpdateMode(true);
+    mpShadowTransSlider->SetSlideHdl( LINK(this, ShadowPropertyPanel, ModifyShadowTransSliderHdl) );
+    SetupIcons();
+    InsertDistanceValues();
+    InsertAngleValues();
+}
+
+IMPL_LINK_NOARG(ShadowPropertyPanel, ClickShadowHdl)
+{
+    if( mpShowShadow->GetState() == TRISTATE_FALSE )
+    {
+        SdrOnOffItem aItem(makeSdrShadowItem(false));
+        GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_SHADOW, SfxCallMode::RECORD, &aItem, 0L);
+    }
+
+    else
+    {
+        SdrOnOffItem aItem(makeSdrShadowItem(true));
+        GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_SHADOW, SfxCallMode::RECORD, &aItem, 0L);
+    }
+
+    return 0L;
+}
+
+IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowColorHdl)
+{
+    XColorItem aItem(makeSdrShadowColorItem(mpLBShadowColor->GetSelectEntryColor()));
+    GetBindings()->GetDispatcher()->Execute(SID_ATTR_SHADOW_COLOR, SfxCallMode::RECORD, &aItem,  0L);
+    return 0;
+}
+
+IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowTransMetricHdl)
+{
+    sal_uInt16 nVal = mpShadowTransMetric->GetValue();
+    SetTransparencyValue(nVal);
+    SdrPercentItem aItem( makeSdrShadowTransparenceItem(nVal) );
+    GetBindings()->GetDispatcher()->Execute(SID_ATTR_SHADOW_TRANSPARENCE, SfxCallMode::RECORD, &aItem , 0L);
+    return 0;
+}
+
+IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowTransSliderHdl)
+{
+    sal_uInt16 nVal = mpShadowTransSlider->GetThumbPos();
+    SetTransparencyValue(nVal);
+    SdrPercentItem aItem( makeSdrShadowTransparenceItem(nVal) );
+    GetBindings()->GetDispatcher()->Execute(SID_ATTR_SHADOW_TRANSPARENCE, SfxCallMode::RECORD, &aItem, 0L);
+    return 0;
+}
+
+IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowDistanceHdl)
+{
+    OUString sAngle = mpShadowAngle->GetText();
+    nXY = mpShadowDistance->GetValue(FUNIT_100TH_MM);
+    switch(ParseText(sAngle))
+    {
+        case 0: nX = nXY; nY = 0;             break;
+        case 45: nX = nXY; nY = -nXY;         break;
+        case 90: nX = 0; nY = - nXY;          break;
+        case 135: nX = nY = -nXY;             break;
+        case 180: nX = -nXY; nY = 0;          break;
+        case 225: nX = -nXY; nY = nXY;        break;
+        case 270: nX = 0; nY = nXY;           break;
+        case 315: nX = nY = nXY;              break;
+    }
+    SdrMetricItem aXItem(makeSdrShadowXDistItem(nX));
+    SdrMetricItem aYItem(makeSdrShadowYDistItem(nY));
+    GetBindings()->GetDispatcher()->Execute(SID_ATTR_SHADOW_XDISTANCE, SfxCallMode::RECORD, &aXItem, 0L);
+    GetBindings()->GetDispatcher()->Execute(SID_ATTR_SHADOW_YDISTANCE, SfxCallMode::RECORD, &aYItem, 0L);
+    return 0;
+}
+
+sal_uInt32 ShadowPropertyPanel::ParseText(OUString sTmp)
+{
+    if (sTmp.isEmpty())
+        return 0;
+    sal_Unicode nChar = sTmp[0];
+    if( nChar == '-' )
+    {
+        if (sTmp.getLength() < 2)
+            return 0;
+        nChar = sTmp[1];
+    }
+
+    if( (nChar < '0') || (nChar > '9') )
+        return 0;
+
+    const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() );
+    const sal_Unicode cSep = rLocaleWrapper.getNumDecimalSep()[0];
+
+    rtl_math_ConversionStatus eStatus;
+    double fTmp = rtl::math::stringToDouble( sTmp, cSep, 0, &eStatus);
+    if (eStatus != rtl_math_ConversionStatus_Ok)
+        return 0;
+
+    return fTmp;
+
+}
+
+void ShadowPropertyPanel::UpdateControls()
+{
+    if(mpShowShadow->GetState() == TRISTATE_FALSE)
+    {
+        mpShadowDistance->Disable();
+        mpLBShadowColor->Disable();
+        mpShadowAngle->Disable();
+        mpFTAngle->Disable();
+        mpFTDistance->Disable();
+        mpFTTransparency->Disable();
+        mpFTColor->Disable();
+        mpShadowTransSlider->Disable();
+        mpShadowTransMetric->Disable();
+        return;
+    }
+    else
+    {
+        mpShadowDistance->Enable();
+        mpLBShadowColor->Enable();
+        mpShadowAngle->Enable();
+        mpFTAngle->Enable();
+        mpFTDistance->Enable();
+        mpFTTransparency->Enable();
+        mpFTColor->Enable();
+        mpShadowTransSlider->Enable();
+        mpShadowTransMetric->Enable();
+    }
+
+    if(nX > 0 && nY == 0) { mpShadowAngle->SelectEntryPos(0); nXY = nX; }
+    else if( nX > 0 && nY < 0 ) { mpShadowAngle->SelectEntryPos(1); nXY = nX; }
+    else if( nX == 0 && nY < 0 ) { mpShadowAngle->SelectEntryPos(2); nXY = -nY; }
+    else if( nX < 0 && nY < 0 ) { mpShadowAngle->SelectEntryPos(3); nXY = -nY; }
+    else if( nX < 0 && nY == 0 ) { mpShadowAngle->SelectEntryPos(4); nXY = -nX; }
+    else if( nX < 0 && nY > 0 ) { mpShadowAngle->SelectEntryPos(5); nXY = nY; }
+    else if( nX == 0 && nY > 0 ) { mpShadowAngle->SelectEntryPos(6); nXY = nY; }
+    else if( nX > 0 && nY > 0 ) { mpShadowAngle->SelectEntryPos(7); nXY = nX; }
+    else { nXY = 0; }
+    mpShadowDistance->SetValue(nXY, FUNIT_100TH_MM);
+}
+
+void ShadowPropertyPanel::SetTransparencyValue(long nVal)
+{
+    mpShadowTransSlider->SetThumbPos(nVal);
+    mpShadowTransMetric->SetValue(nVal);
+}
+
+void ShadowPropertyPanel::SetupIcons()
+{
+    if(Theme::GetBoolean(Theme::Bool_UseSymphonyIcons))
+    {
+        // todo
+    }
+    else
+    {
+        // todo
+    }
+}
+
+void ShadowPropertyPanel::DataChanged(const DataChangedEvent& /*rEvent*/)
+{
+    SetupIcons();
+}
+
+void ShadowPropertyPanel::InsertDistanceValues()
+{
+    for(sal_uInt16 i = 0; i <= 20 ; i++)
+        mpShadowDistance->InsertValue(i*2,FUNIT_POINT);
+}
+
+void ShadowPropertyPanel::InsertAngleValues()
+{
+    mpShadowAngle->InsertValue(0, FUNIT_CUSTOM);
+    mpShadowAngle->InsertValue(45, FUNIT_CUSTOM);
+    mpShadowAngle->InsertValue(90, FUNIT_CUSTOM);
+    mpShadowAngle->InsertValue(135, FUNIT_CUSTOM);
+    mpShadowAngle->InsertValue(180, FUNIT_CUSTOM);
+    mpShadowAngle->InsertValue(225,FUNIT_CUSTOM);
+    mpShadowAngle->InsertValue(270, FUNIT_CUSTOM);
+    mpShadowAngle->InsertValue(315,FUNIT_CUSTOM);
+}
+
+void ShadowPropertyPanel::NotifyItemUpdate(
+    sal_uInt16 nSID,
+    SfxItemState eState,
+    const SfxPoolItem* pState,
+    const bool /*bIsEnabled*/)
+{
+    switch(nSID)
+    {
+        case SID_ATTR_FILL_SHADOW:
+        {
+            if(eState >= SfxItemState::DEFAULT)
+            {
+                const SdrOnOffItem* pItem = dynamic_cast< const SdrOnOffItem* >(pState);
+                if(pItem)
+                {
+                    if(pItem->GetValue())
+                        mpShowShadow->SetState( TRISTATE_TRUE );
+                    else
+                        mpShowShadow->SetState( TRISTATE_FALSE );
+                }
+                else
+                    mpShowShadow.reset();
+            }
+        }
+        break;
+
+        case SID_ATTR_SHADOW_TRANSPARENCE:
+        {
+            if(eState >= SfxItemState::DEFAULT)
+            {
+                const SdrPercentItem* pTransparencyItem = dynamic_cast< const SdrPercentItem* >(pState);
+                if(pTransparencyItem)
+                {
+                    const sal_uInt16 nVal = pTransparencyItem->GetValue();
+                    SetTransparencyValue(nVal);
+                }
+                else
+                    SetTransparencyValue(0);
+            }
+        }
+        break;
+
+        case SID_ATTR_SHADOW_COLOR:
+        {
+            if(eState >= SfxItemState::DEFAULT)
+            {
+                const XColorItem* pColorItem = dynamic_cast< const XColorItem* >(pState);
+                if(pColorItem)
+                {
+                   mpLBShadowColor->SelectEntry(pColorItem->GetColorValue());
+                }
+                else
+                {
+                }
+            }
+        }
+        break;
+        case SID_ATTR_SHADOW_XDISTANCE:
+        {
+            if(eState >= SfxItemState::DEFAULT)
+            {
+                const SdrMetricItem* pXDistItem = dynamic_cast< const SdrMetricItem* >(pState);
+                if(pXDistItem)
+                {
+                    nX = pXDistItem->GetValue();
+                }
+            }
+        }
+        break;
+        case SID_ATTR_SHADOW_YDISTANCE:
+        {
+            if(eState >= SfxItemState::DEFAULT)
+            {
+                const SdrMetricItem* pYDistItem = dynamic_cast< const SdrMetricItem* >(pState);
+                if(pYDistItem)
+                {
+                    nY = pYDistItem->GetValue();
+                }
+            }
+        }
+        break;
+    }
+    UpdateControls();
+}
+
+VclPtr<vcl::Window> ShadowPropertyPanel::Create (
+    vcl::Window* pParent,
+    const uno::Reference<frame::XFrame>& rxFrame,
+    SfxBindings* pBindings)
+{
+    if(pParent == NULL)
+        throw lang::IllegalArgumentException("no parent Window given to ShadowPropertyPanel::Create", NULL, 0);
+    if( !rxFrame.is() )
+        throw lang::IllegalArgumentException("no XFrame given to ShadowPropertyPanel::Create", NULL, 1);
+    if(pBindings == NULL)
+        throw lang::IllegalArgumentException("no SfxBindings given to ShadowPropertyPanel::Create", NULL, 2);
+
+    return VclPtr<ShadowPropertyPanel>::Create(pParent, rxFrame, pBindings);
+}
+}
+
+}
diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx b/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx
new file mode 100644
index 0000000..c32f327
--- /dev/null
+++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx
@@ -0,0 +1,97 @@
+#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_AREA_SHADOWPROPERTYPANEL_HXX
+#define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_SHADOWPROPERTYPANEL_HXX
+
+#include <vcl/slider.hxx>
+#include <vcl/button.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/vclptr.hxx>
+#include <sfx2/sidebar/SidebarPanelBase.hxx>
+#include <vcl/ctrl.hxx>
+#include <sfx2/sidebar/ControllerItem.hxx>
+#include <svx/sidebar/PanelLayout.hxx>
+#include <svl/intitem.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/field.hxx>
+#include <vcl/slider.hxx>
+#include <boost/scoped_ptr.hpp>
+#include <com/sun/star/ui/XUIElement.hpp>
+#include <sfx2/request.hxx>
+#include <svx/dlgctrl.hxx>
+
+
+
+namespace svx { namespace sidebar {
+
+class ShadowPropertyPanel
+:   public PanelLayout,
+    public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
+{
+public:
+    virtual ~ShadowPropertyPanel();
+    virtual void dispose() SAL_OVERRIDE;
+
+    static VclPtr<vcl::Window> Create(
+    vcl::Window* pParent,
+    const css::uno::Reference<css::frame::XFrame>& rxFrame,
+    SfxBindings* pBindings);
+
+    virtual void DataChanged(
+    const DataChangedEvent& rEvent) SAL_OVERRIDE;
+
+    virtual void NotifyItemUpdate(
+        const sal_uInt16 nSId,
+        const SfxItemState eState,
+        const SfxPoolItem* pState,
+        const bool bIsEnabled) SAL_OVERRIDE;
+
+    SfxBindings* GetBindings() { return mpBindings;}
+
+    void Initialize();
+
+    ShadowPropertyPanel(
+        vcl::Window* pParent,
+        const css::uno::Reference<css::frame::XFrame>& rxFrame,
+        SfxBindings* pBindings);
+
+private:
+    VclPtr<CheckBox>   mpShowShadow;
+    VclPtr<MetricBox>       mpShadowDistance;
+    VclPtr<ColorLB>       mpLBShadowColor;
+    VclPtr<MetricBox>       mpShadowAngle;
+    VclPtr<FixedText>     mpFTAngle;
+    VclPtr<FixedText>     mpFTDistance;
+    VclPtr<FixedText>     mpFTTransparency;
+    VclPtr<FixedText>     mpFTColor;
+    VclPtr<Slider>        mpShadowTransSlider;
+    VclPtr<MetricField>   mpShadowTransMetric;
+    XColorListRef         pColorList;
+    bool bDisabled;
+
+    ::sfx2::sidebar::ControllerItem maShadowController;
+    ::sfx2::sidebar::ControllerItem maShadowTransController;
+    ::sfx2::sidebar::ControllerItem maShadowColorController;
+    ::sfx2::sidebar::ControllerItem maShadowXDistanceController;
+    ::sfx2::sidebar::ControllerItem maShadowYDistanceController;
+
+    css::uno::Reference<css::frame::XFrame> mxFrame;
+
+    SfxBindings* mpBindings;
+    long nX,nY,nXY;
+
+    static void SetupIcons();
+    void InsertDistanceValues();
+    void InsertAngleValues();
+    void SetTransparencyValue(long);
+    void UpdateControls();
+    sal_uInt32 ParseText(OUString pStr);
+    DECL_LINK(ClickShadowHdl, void*);
+    DECL_LINK(ModifyShadowColorHdl, void*);
+    DECL_LINK(ModifyShadowTransMetricHdl, void*);
+    DECL_LINK(ModifyShadowDistanceHdl, void*);
+    DECL_LINK(ModifyShadowTransSliderHdl, void*);
+};
+}
+}
+
+#endif
+
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 18368c5..2b22692 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -323,6 +323,10 @@ SdrItemPool::SdrItemPool(
 
     // set own ItemInfos
     mpLocalItemInfos[SDRATTR_SHADOW-SDRATTR_START]._nSID=SID_ATTR_FILL_SHADOW;
+    mpLocalItemInfos[SDRATTR_SHADOWCOLOR-SDRATTR_START]._nSID=SID_ATTR_SHADOW_COLOR;
+    mpLocalItemInfos[SDRATTR_SHADOWTRANSPARENCE-SDRATTR_START]._nSID=SID_ATTR_SHADOW_TRANSPARENCE;
+    mpLocalItemInfos[SDRATTR_SHADOWXDIST-SDRATTR_START]._nSID=SID_ATTR_SHADOW_XDISTANCE;
+    mpLocalItemInfos[SDRATTR_SHADOWYDIST-SDRATTR_START]._nSID=SID_ATTR_SHADOW_YDISTANCE;
     mpLocalItemInfos[SDRATTR_TEXT_FITTOSIZE-SDRATTR_START]._nSID=SID_ATTR_TEXT_FITTOSIZE;
     mpLocalItemInfos[SDRATTR_GRAFCROP-SDRATTR_START]._nSID=SID_ATTR_GRAF_CROP;
 
diff --git a/svx/uiconfig/ui/sidebarshadow.ui b/svx/uiconfig/ui/sidebarshadow.ui
new file mode 100644
index 0000000..1eca4d9
--- /dev/null
+++ b/svx/uiconfig/ui/sidebarshadow.ui
@@ -0,0 +1,210 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+  <requires lib="gtk+" version="3.0"/>
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="lower">-180</property>
+    <property name="upper">360</property>
+  </object>
+  <object class="GtkGrid" id="ShadowPropertyPanel">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <child>
+      <object class="GtkGrid" id="grid3">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="hexpand">True</property>
+        <property name="vexpand">True</property>
+        <property name="border_width">6</property>
+        <child>
+          <object class="GtkBox" id="box2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="orientation">vertical</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkCheckButton" id="SHOW_SHADOW">
+                <property name="label" translatable="yes">Enable</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="xalign">0</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkGrid" id="grid1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="orientation">vertical</property>
+                <property name="row_spacing">6</property>
+                <property name="column_spacing">6</property>
+                <child>
+                  <object class="GtkLabel" id="angle">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Angle</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="distance">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Distance</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="VclComboBoxNumeric" id="LB_ANGLE:0degrees">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="hexpand">True</property>
+                    <property name="adjustment">adjustment1</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="VclComboBoxNumeric" id="LB_DISTANCE:0pt">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="hexpand">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkBox" id="box1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="orientation">vertical</property>
+                <child>
+                  <object class="GtkLabel" id="transparency_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Transparency:</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkGrid" id="grid2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="column_spacing">6</property>
+                    <child>
+                      <object class="GtkSpinButton" id="FIELD_TRANSPARENCY:0%">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="halign">end</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">2</property>
+                        <property name="top_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkScale" id="transparency_slider">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="round_digits">1</property>
+                        <property name="draw_value">False</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">0</property>
+                        <property name="width">2</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkGrid" id="grid4">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="column_spacing">6</property>
+                <child>
+                  <object class="GtkLabel" id="color">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="hexpand">True</property>
+                    <property name="label" translatable="yes">Color:</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="svxlo-ColorLB" id="LB_SHADOW_COLOR">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="halign">end</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">0</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">3</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">0</property>
+      </packing>
+    </child>
+  </object>
+</interface>
commit 64bc8b45b5c23efc5fe57585a69aa4263aaf4e83
Author: Regina Henschel <regina at apache.org>
Date:   Wed Jul 8 12:31:43 2015 +0000

    i#107734 Support for Math Input Panel in Windows 7
    
    The patch introduces a new command .uno:ImportMathClipboard to module Math.
    It imports MathML content from clipboard and transforms it to Starmath
    It handles clipboard MIME type 'application/mathml+xml' and
    plain text, which can be interpreted as MathML segment.
    It partly solves issues #i14252, #i34781, and #i53509 too.
    Review by: Hanya <hanya.runo at gmail.com>
    (cherry picked from commit 9ec2148653436be8612273439180749e71e2ce58)
    
    Conflicts:
    	dtrans/source/win32/ftransl/ftransl.cxx
    	officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
    	sot/inc/sot/formats.hxx
    	sot/source/base/exchange.cxx
    	starmath/sdi/smath.sdi
    	starmath/source/view.cxx
    
    Change-Id: I6cb5e8f737ee2e39f9ce96aba841db347a8806e4

diff --git a/dtrans/source/win32/ftransl/ftransl.cxx b/dtrans/source/win32/ftransl/ftransl.cxx
index bc14f54..7fe0b55 100644
--- a/dtrans/source/win32/ftransl/ftransl.cxx
+++ b/dtrans/source/win32/ftransl/ftransl.cxx
@@ -458,6 +458,8 @@ void SAL_CALL CDataFormatTranslator::initTranslationTable()
     m_TranslTable.push_back(FormatEntry("image/bmp", "Windows Bitmap", NULL, CF_INVALID, CPPUTYPE_DEFAULT));
     //SotClipboardFormatId::PNG
     m_TranslTable.push_back(FormatEntry("image/png", "PNG", NULL, CF_INVALID, CPPUTYPE_DEFAULT));
+    //SotClipboardFormatId::MATHML
+    m_TranslTable.push_back(FormatEntry("application/mathml+xml", "MathML", NULL, CF_INVALID, CPPUTYPE_DEFAULT));
     //SotClipboardFormatId::DUMMY3
     m_TranslTable.push_back(FormatEntry("application/x-openoffice-dummy3;windows_formatname=\"SO_DUMMYFORMAT_3\"", "SO_DUMMYFORMAT_3", NULL, CF_INVALID, CPPUTYPE_DEFAULT));
     //SotClipboardFormatId::DUMMY4
diff --git a/include/sot/formats.hxx b/include/sot/formats.hxx
index cb2ee82..c85a10f 100644
--- a/include/sot/formats.hxx
+++ b/include/sot/formats.hxx
@@ -185,8 +185,9 @@ enum class SotClipboardFormatId : sal_uLong
     HC_GDIMETAFILE         = 140,
     PNG                    = 141,
     STARWRITERGLOB_8_TEMPLATE = 142,
+    MATHML                 = 143,
     // the point at which we start allocating "runtime" format IDs
-    USER_END  = STARWRITERGLOB_8_TEMPLATE
+    USER_END  = MATHML
 };
 
 /** Make it easier to iterate over format IDs */
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
index 02c5b52..4d612cd 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
@@ -43,6 +43,11 @@
           <value xml:lang="en-US">~Import Formula...</value>
         </prop>
       </node>
+      <node oor:name=".uno:ImportMathMLClipboard" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Import MathML from Clipboard</value>
+        </prop>
+      </node>
       <node oor:name=".uno:FitInWindow" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">Fit To Window</value>
diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx
index 8b3541f..599525d 100644
--- a/sot/source/base/exchange.cxx
+++ b/sot/source/base/exchange.cxx
@@ -201,6 +201,7 @@ namespace
             /*140 SotClipboardFormatId::GDIMETAFILE*/                  { "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"", "High Contrast GDIMetaFile", &cppu::UnoType<Sequence<sal_Int8>>::get() },
             /*141 SotClipboardFormatId::PNG*/                    { "image/png", "PNG Bitmap", &cppu::UnoType<Sequence<sal_Int8>>::get() },
             /*142 SotClipboardFormatId::STARWRITERGLOB_8_TEMPLATE*/      { MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_TEMPLATE_ASCII, "Writer/Global 8 Template", &cppu::UnoType<Sequence<sal_Int8>>::get() },
+            /*143 SotClipboardFormatId::MATHML*/   { "application/mathml+xml", "MathML", &::cppu::UnoType<const Sequence< sal_Int8 >>::get() },
             };
         return &aInstance[0];
         }
diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc
index 7196b26..6bf6e21 100644
--- a/starmath/inc/starmath.hrc
+++ b/starmath/inc/starmath.hrc
@@ -45,6 +45,7 @@
 #define SID_SYMBOLS                 (SID_SMA_START + 56) // Has to be picked up again for now!
 #define SID_TEXTMODE                (SID_SMA_START + 57)
 #define SID_IMPORT_FORMULA          (SID_SMA_START + 58)
+#define SID_IMPORT_MATHML_CLIPBOARD (SID_SMA_START + 59)
 #define SID_TEXT                    (SID_SMA_START + 100)
 #define SID_GAPHIC_SM               (SID_SMA_START + 101)
 /** Command for inserting a symbol specified by a string (Inserts an SmSpecialNode) */
diff --git a/starmath/sdi/smath.sdi b/starmath/sdi/smath.sdi
index 94cacca..bbf5a6b 100644
--- a/starmath/sdi/smath.sdi
+++ b/starmath/sdi/smath.sdi
@@ -418,6 +418,29 @@ SfxBoolItem ImportFormula SID_IMPORT_FORMULA
     GroupId = GID_INSERT;
 ]
 
+SfxBoolItem ImportMathMLClipboard SID_IMPORT_MATHML_CLIPBOARD
+()
+[
+    /* flags: */
+    AutoUpdate = FALSE,
+    Cachable = Cachable,
+    FastCall = TRUE,
+    HasCoreId = FALSE, /*obsolete */
+    HasDialog = FALSE, /*obsolete */
+    ReadOnlyDoc = FALSE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE, /*obsolete */
+    RecordPerSet;
+    Synchron;
+
+    /* config: */
+    AccelConfig = TRUE,
+    MenuConfig = TRUE,
+    StatusBarConfig = FALSE,
+    ToolBoxConfig = TRUE,
+    GroupId = GID_INSERT;
+]
 
 SfxVoidItem LoadSymbols SID_LOADSYMBOLS
 ()
diff --git a/starmath/sdi/smslots.sdi b/starmath/sdi/smslots.sdi
index 9857d39..a43eb7c 100644
--- a/starmath/sdi/smslots.sdi
+++ b/starmath/sdi/smslots.sdi
@@ -251,6 +251,12 @@ interface FormulaView
         StateMethod = GetState ;
         Export = FALSE ;
     ]
+    SID_IMPORT_MATHML_CLIPBOARD //idlpp ole : no , status : no
+    [
+        ExecMethod = Execute ;
+        StateMethod = GetState ;
+        Export = FALSE ;
+    ]
     //idlpp kein Menueeintrag , also keine Texte
     SID_ATTR_ZOOM //idlpp ole : no , status : no
     [
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 6bed0c3..1c4ca54 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -61,6 +61,7 @@
 #include <vcl/settings.hxx>
 
 #include <fstream>
+#include <unotools/streamwrap.hxx>
 
 #include "unomodel.hxx"
 #include "view.hxx"
@@ -1653,6 +1654,80 @@ void SmViewShell::Execute(SfxRequest& rReq)
             break;
         }
 
+        case SID_IMPORT_MATHML_CLIPBOARD:
+        {
+            TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard(GetEditWindow()) );
+            uno::Reference < io::XInputStream > xStrm;
+            SotClipboardFormatId nId = SOT_FORMAT_SYSTEM_START; //dummy initialize to avoid warning
+            if  ( aDataHelper.GetTransferable().is() )
+            {
+                if (aDataHelper.HasFormat(nId = SotClipboardFormatId::MATHML))
+                {
+                    xStrm = aDataHelper.GetInputStream(nId, "");
+                    if (xStrm.is())
+                    {
+                        SfxMedium* pClipboardMedium = new SfxMedium();
+                        pClipboardMedium->GetItemSet(); //generate initial itemset, not sure if necessary
+                        const SfxFilter* pMathFilter =
+                            SfxFilter::GetFilterByName(OUString::createFromAscii(MATHML_XML));
+                        pClipboardMedium->SetFilter(pMathFilter);
+                        pClipboardMedium->setStreamToLoadFrom(xStrm, true /*bIsReadOnly*/);
+                        InsertFrom(*pClipboardMedium);
+                        GetDoc()->UpdateText();
+                        delete pClipboardMedium;
+                    }
+                }
+                else
+                {
+                    if (aDataHelper.HasFormat(nId = SotClipboardFormatId::STRING))
+                    {
+                        // In case of FORMAT_STRING no stream exists, need to generate one
+                        ::rtl::OUString aString;
+                        if (aDataHelper.GetString( nId, aString))
+                        {
+                            SfxMedium* pClipboardMedium = new SfxMedium();
+                            pClipboardMedium->GetItemSet(); //generates initial itemset, not sure if necessary
+                            const SfxFilter* pMathFilter =
+                                SfxFilter::GetFilterByName(OUString::createFromAscii(MATHML_XML));
+                            pClipboardMedium->SetFilter(pMathFilter);
+
+                            SvMemoryStream * pStrm;
+                            // The text to be imported might asserts encoding like 'encoding="utf-8"' but FORMAT_STRING is UTF-16.
+                            // Force encoding to UTF-16, if encoding exists.
+                            bool bForceUTF16 = false;
+                            sal_Int32 nPosL = aString.indexOf( OUString::createFromAscii("encoding=\""));
+                            sal_Int32 nPosU = -1;
+                            if ( nPosL >= 0 && nPosL +10 < aString.getLength() )
+                            {
+                                nPosL += 10;
+                                nPosU = aString.indexOf( '"',nPosL);
+                                if (nPosU > nPosL)
+                                {
+                                    bForceUTF16 = true;
+                                }
+                            }
+                            if ( bForceUTF16 )
+                            {
+                                OUString aNewString = aString.replaceAt( nPosL,nPosU-nPosL,OUString::createFromAscii("UTF-16"));
+                                pStrm = new SvMemoryStream( (void*)aNewString.getStr(), aNewString.getLength() * sizeof(sal_Unicode), StreamMode::READ);
+                            }
+                            else
+                            {
+                                pStrm = new SvMemoryStream( (void*)aString.getStr(), aString.getLength() * sizeof(sal_Unicode), StreamMode::READ);
+                            }
+                            uno::Reference<io::XInputStream> xStrm2( new ::utl::OInputStreamWrapper(*pStrm) );
+                            pClipboardMedium->setStreamToLoadFrom(xStrm2, true /*bIsReadOnly*/);
+                            InsertFrom(*pClipboardMedium);
+                            GetDoc()->UpdateText();
+                            delete pClipboardMedium;
+                            delete pStrm;
+                        }
+                    }
+                }
+            }
+            break;
+        }
+
         case SID_NEXTERR:
             NextError();
             if (pWin)
diff --git a/starmath/uiconfig/smath/menubar/menubar.xml b/starmath/uiconfig/smath/menubar/menubar.xml
index 5a8edbb..60c48ff 100644
--- a/starmath/uiconfig/smath/menubar/menubar.xml
+++ b/starmath/uiconfig/smath/menubar/menubar.xml
@@ -116,6 +116,7 @@
     <menu:menupopup>
       <menu:menuitem menu:id=".uno:SymbolCatalogue"/>
       <menu:menuitem menu:id=".uno:ImportFormula"/>
+      <menu:menuitem menu:id=".uno:ImportMathMLClipboard"/>
       <menu:menuseparator/>
       <menu:menu menu:id=".uno:MacrosMenu">
         <menu:menupopup>
commit 26aebe26f706d9fbc9c113f5c1fdc495578435bf
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jul 8 15:47:57 2015 +0200

    vcl: use SAL_INFO for available X11 clipboard formats
    
    Change-Id: Ifbd87e59fa91241dd5852f7dc6b63e65d8ca6bad

diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index 70f3456..3eb754c 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -407,6 +407,7 @@ certain functionality.
 @li @c vcl.sm - Session Manager
 @li @c vcl.unity
 @li @c vcl.unx.print
+ at li @c vcl.unx.dtrans
 @li @c vcl.virdev
 @li @c vcl.window
 @li @c vcl.wmf
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx
index fc4e97b..a323791 100644
--- a/vcl/unx/generic/dtrans/X11_selection.cxx
+++ b/vcl/unx/generic/dtrans/X11_selection.cxx
@@ -1305,10 +1305,8 @@ bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor >
         sal_Int32 nNativeTypesIndex = 0;
         while( nAtoms-- )
         {
-#if OSL_DEBUG_LEVEL > 1
-            if( *pAtoms && *pAtoms < 0x01000000 )
-                fprintf( stderr, "native type: %s\n", OUStringToOString( getString( *pAtoms ), RTL_TEXTENCODING_ISO_8859_1 ).getStr() );
-#endif
+            SAL_INFO_IF(*pAtoms && *pAtoms < 0x01000000, "vcl.unx.dtrans",
+                "getPasteDataTypes: available: \"" << getString(*pAtoms) << "\"");
             if( *pAtoms == m_nCOMPOUNDAtom )
                 bHaveText = bHaveCompound = true;
             else if( *pAtoms && *pAtoms < 0x01000000 )
commit 394c5057e2c2a10bc09504646eed1b80e3cb061c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Jul 7 15:07:59 2015 +0200

    sw: let's try some C++11 syntax for function pointers
    
    Less ugly or just differently ugly? Hard to tell...
    
    Change-Id: I1265f07f39ebbc65acfcc30242bc7cd7d46207e7
    Reviewed-on: https://gerrit.libreoffice.org/16821
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx
index 40715b4..cce42c0 100644
--- a/sw/inc/pam.hxx
+++ b/sw/inc/pam.hxx
@@ -143,7 +143,9 @@ typedef SwMoveFnCollection* SwMoveFn;
 SW_DLLPUBLIC extern SwMoveFn fnMoveForward; ///< SwPam::Move()/Find() default argument.
 SW_DLLPUBLIC extern SwMoveFn fnMoveBackward;
 
-typedef bool (*SwGoInDoc)( SwPaM& rPam, SwMoveFn fnMove );
+// also works: using SwGoInDoc = bool (*) (SwPaM& rPam, SwMoveFn fnMove);
+// no works: using SwGoInDoc = [](SwPaM& rPam, SwMoveFn fnMove) -> bool;
+using SwGoInDoc = auto (*)(SwPaM& rPam, SwMoveFn fnMove) -> bool;
 SW_DLLPUBLIC extern SwGoInDoc fnGoDoc;
 extern SwGoInDoc fnGoSection;
 SW_DLLPUBLIC extern SwGoInDoc fnGoNode;
commit 61b1697069c50ff72339d4592add42ab72b03243
Author: Matthew J. Francis <mjay.francis at gmail.com>
Date:   Mon Jul 6 08:09:24 2015 +0800

    Reduce the amount of up front work in performing introspection
    
    Previously, when using PyUNO over a remote bridge, each remote
    call which returned an object could result in 50+ further calls
    to query interfaces on the result, regardless of whether and
    how the object was then used. The majority of these queries
    were made under css.script.Invocation to pre-cache certain
    information about the returned object.
    
    By making better use of available information to eliminate
    interface queries which are certain to fail, and lazily
    acquiring those interfaces which are required, remote scripting
    is significantly accelerated. In general, this also gives a
    small speedup for local scripting.
    
    Change-Id: I4f36da6b5f09cb0d22f21291f05fbea2ae7ae697
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx
index e6b9110..cfa7085 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -162,6 +162,7 @@ class IntrospectionAccessStatic_Impl: public salhelper::SimpleReferenceObject
 {
     friend class Implementation;
     friend class ImplIntrospectionAccess;
+    friend class ImplIntrospectionAdapter;
 
     // Holding CoreReflection
     Reference< XIdlReflection > mxCoreReflection;
@@ -194,8 +195,16 @@ class IntrospectionAccessStatic_Impl: public salhelper::SimpleReferenceObject
     sal_Int32 mnAttributePropCount;
     sal_Int32 mnMethodPropCount;
 
-    // Flag, if a FastPropertySet is supported
+    // Flags which indicate if various interfaces are present
     bool mbFastPropSet;
+    bool mbPropertySet;
+    bool mbElementAccess;
+    bool mbNameAccess;
+    bool mbNameContainer;
+    bool mbIndexAccess;
+    bool mbIndexContainer;
+    bool mbEnumerationAccess;
+    bool mbIdlArray;
 
     // Original-Handles of FastPropertySets
     sal_Int32* mpOrgPropertyHandleArray;
@@ -261,6 +270,15 @@ IntrospectionAccessStatic_Impl::IntrospectionAccessStatic_Impl( Reference< XIdlR
     maPropertyConceptSeq.realloc( ARRAY_SIZE_STEP );
 
     mbFastPropSet = false;
+    mbPropertySet = false;
+    mbElementAccess = false;
+    mbNameAccess = false;
+    mbNameContainer = false;
+    mbIndexAccess = false;
+    mbIndexContainer = false;
+    mbEnumerationAccess = false;
+    mbIdlArray = false;
+
     mpOrgPropertyHandleArray = NULL;
 
     mnPropCount = 0;
@@ -772,6 +790,9 @@ class ImplIntrospectionAdapter :
     // Objekt als Interface
     Reference<XInterface> mxIface;
 
+    // Guards the caching of queried interfaces
+    osl::Mutex m_aMutex;
+
     // Original-Interfaces des Objekts
     Reference<XElementAccess>        mxObjElementAccess;
     Reference<XNameContainer>        mxObjNameContainer;
@@ -781,6 +802,14 @@ class ImplIntrospectionAdapter :
     Reference<XEnumerationAccess>    mxObjEnumerationAccess;
     Reference<XIdlArray>            mxObjIdlArray;
 
+    Reference<XElementAccess> getXElementAccess();
+    Reference<XNameContainer> getXNameContainer();
+    Reference<XNameAccess> getXNameAccess();
+    Reference<XIndexContainer> getXIndexContainer();
+    Reference<XIndexAccess> getXIndexAccess();
+    Reference<XEnumerationAccess> getXEnumerationAccess();
+    Reference<XIdlArray> getXIdlArray();
+
 public:
     ImplIntrospectionAdapter( ImplIntrospectionAccess* pAccess_,
         const Any& obj,
@@ -861,6 +890,112 @@ public:
         throw( IllegalArgumentException, ArrayIndexOutOfBoundsException, RuntimeException, std::exception ) SAL_OVERRIDE;
 };
 
+Reference<XElementAccess> ImplIntrospectionAdapter::getXElementAccess()
+{
+    ResettableGuard< Mutex > aGuard( m_aMutex );
+
+    if( !mxObjElementAccess.is() )
+    {
+        aGuard.clear();
+        Reference<XElementAccess> xElementAccess = Reference<XElementAccess>::query( mxIface );
+        aGuard.reset();
+        if( !mxObjElementAccess.is() )
+            mxObjElementAccess = xElementAccess;
+    }
+    return mxObjElementAccess;
+}
+
+Reference<XNameContainer> ImplIntrospectionAdapter::getXNameContainer()
+{
+    ResettableGuard< Mutex > aGuard( m_aMutex );
+
+    if( !mxObjNameContainer.is() )
+    {
+        aGuard.clear();
+        Reference<XNameContainer> xNameContainer = Reference<XNameContainer>::query( mxIface );
+        aGuard.reset();
+        if( !mxObjNameContainer.is() )
+            mxObjNameContainer = xNameContainer;
+    }
+    return mxObjNameContainer;
+}
+
+Reference<XNameAccess> ImplIntrospectionAdapter::getXNameAccess()
+{
+    ResettableGuard< Mutex > aGuard( m_aMutex );
+
+    if( !mxObjNameAccess.is() )
+    {
+        aGuard.clear();
+        Reference<XNameAccess> xNameAccess = Reference<XNameAccess>::query( mxIface );
+        aGuard.reset();
+        if( !mxObjNameAccess.is() )
+            mxObjNameAccess = xNameAccess;
+    }
+    return mxObjNameAccess;
+}
+
+Reference<XIndexContainer> ImplIntrospectionAdapter::getXIndexContainer()
+{
+    ResettableGuard< Mutex > aGuard( m_aMutex );
+
+    if( !mxObjIndexContainer.is() )
+    {
+        aGuard.clear();
+        Reference<XIndexContainer> xIndexContainer = Reference<XIndexContainer>::query( mxIface );
+        aGuard.reset();
+        if( !mxObjIndexContainer.is() )
+            mxObjIndexContainer = xIndexContainer;
+    }
+    return mxObjIndexContainer;
+}
+
+Reference<XIndexAccess> ImplIntrospectionAdapter::getXIndexAccess()
+{
+    ResettableGuard< Mutex > aGuard( m_aMutex );
+
+    if( !mxObjIndexAccess.is() )
+    {
+        aGuard.clear();
+        Reference<XIndexAccess> xIndexAccess = Reference<XIndexAccess>::query( mxIface );
+        aGuard.reset();
+        if( !mxObjIndexAccess.is() )
+            mxObjIndexAccess = xIndexAccess;
+    }
+    return mxObjIndexAccess;
+}
+
+Reference<XEnumerationAccess> ImplIntrospectionAdapter::getXEnumerationAccess()
+{
+    ResettableGuard< Mutex > aGuard( m_aMutex );
+
+    if( !mxObjEnumerationAccess.is() )
+    {
+        aGuard.clear();
+        Reference<XEnumerationAccess> xEnumerationAccess = Reference<XEnumerationAccess>::query( mxIface );
+        aGuard.reset();
+        if( !mxObjEnumerationAccess.is() )
+            mxObjEnumerationAccess = xEnumerationAccess;
+    }
+    return mxObjEnumerationAccess;
+}
+
+Reference<XIdlArray> ImplIntrospectionAdapter::getXIdlArray()
+{
+    ResettableGuard< Mutex > aGuard( m_aMutex );
+
+    if( !mxObjIdlArray.is() )
+    {
+        aGuard.clear();
+        Reference<XIdlArray> xIdlArray = Reference<XIdlArray>::query( mxIface );
+        aGuard.reset();
+        if( !mxObjIdlArray.is() )
+            mxObjIdlArray = xIdlArray;
+    }
+    return mxObjIdlArray;
+}
+
+
 ImplIntrospectionAdapter::ImplIntrospectionAdapter( ImplIntrospectionAccess* pAccess_,
     const Any& obj,
     rtl::Reference< IntrospectionAccessStatic_Impl > const & pStaticImpl_ )
@@ -869,17 +1004,7 @@ ImplIntrospectionAdapter::ImplIntrospectionAdapter( ImplIntrospectionAccess* pAc
     // Objekt als Interfaceholen
     TypeClass eType = mrInspectedObject.getValueType().getTypeClass();
     if( eType == TypeClass_INTERFACE )
-    {
         mxIface = *static_cast<Reference< XInterface > const *>(mrInspectedObject.getValue());
-
-        mxObjElementAccess = Reference<XElementAccess>::query( mxIface );
-        mxObjNameAccess = Reference<XNameAccess>::query( mxIface );
-        mxObjNameContainer = Reference<XNameContainer>::query( mxIface );
-        mxObjIndexAccess = Reference<XIndexAccess>::query( mxIface );
-        mxObjIndexContainer = Reference<XIndexContainer>::query( mxIface );
-        mxObjEnumerationAccess = Reference<XEnumerationAccess>::query( mxIface );
-        mxObjIdlArray = Reference<XIdlArray>::query( mxIface );
-    }
 }
 
 // Methoden von XInterface
@@ -897,14 +1022,14 @@ Any SAL_CALL ImplIntrospectionAdapter::queryInterface( const Type& rType )
     if( !aRet.hasValue() )
     {
         // Wrapper fuer die Objekt-Interfaces
-        if(   ( mxObjElementAccess.is() && (aRet = ::cppu::queryInterface
+        if(   ( mpStaticImpl->mbElementAccess && (aRet = ::cppu::queryInterface
                     ( rType, static_cast< XElementAccess* >( static_cast< XNameAccess* >( this ) ) ) ).hasValue() )
-            || ( mxObjNameAccess.is() && (aRet = ::cppu::queryInterface( rType, static_cast< XNameAccess* >( this ) ) ).hasValue() )
-            || ( mxObjNameContainer.is() && (aRet = ::cppu::queryInterface( rType, static_cast< XNameContainer* >( this ) ) ).hasValue() )
-            || ( mxObjIndexAccess.is() && (aRet = ::cppu::queryInterface( rType, static_cast< XIndexAccess* >( this ) ) ).hasValue() )
-            || ( mxObjIndexContainer.is() && (aRet = ::cppu::queryInterface( rType, static_cast< XIndexContainer* >( this ) ) ).hasValue() )
-            || ( mxObjEnumerationAccess    .is() && (aRet = ::cppu::queryInterface( rType, static_cast< XEnumerationAccess* >( this ) ) ).hasValue() )
-            || ( mxObjIdlArray.is() && (aRet = ::cppu::queryInterface( rType, static_cast< XIdlArray* >( this ) ) ).hasValue() )
+            || ( mpStaticImpl->mbNameAccess && (aRet = ::cppu::queryInterface( rType, static_cast< XNameAccess* >( this ) ) ).hasValue() )
+            || ( mpStaticImpl->mbNameContainer && (aRet = ::cppu::queryInterface( rType, static_cast< XNameContainer* >( this ) ) ).hasValue() )
+            || ( mpStaticImpl->mbIndexAccess && (aRet = ::cppu::queryInterface( rType, static_cast< XIndexAccess* >( this ) ) ).hasValue() )
+            || ( mpStaticImpl->mbIndexContainer && (aRet = ::cppu::queryInterface( rType, static_cast< XIndexContainer* >( this ) ) ).hasValue() )
+            || ( mpStaticImpl->mbEnumerationAccess && (aRet = ::cppu::queryInterface( rType, static_cast< XEnumerationAccess* >( this ) ) ).hasValue() )
+            || ( mpStaticImpl->mbIdlArray && (aRet = ::cppu::queryInterface( rType, static_cast< XIdlArray* >( this ) ) ).hasValue() )
           )
         {
         }
@@ -1021,121 +1146,120 @@ sal_Bool ImplIntrospectionAdapter::hasPropertyByName(const OUString& Name)
 // Methoden von XElementAccess
 Type ImplIntrospectionAdapter::getElementType() throw( RuntimeException, std::exception )
 {
-    return mxObjElementAccess->getElementType();
+    return getXElementAccess()->getElementType();
 }
 
 sal_Bool ImplIntrospectionAdapter::hasElements() throw( RuntimeException, std::exception )
 {
-    return mxObjElementAccess->hasElements();
+    return getXElementAccess()->hasElements();
 }
 
 // Methoden von XNameAccess
 Any ImplIntrospectionAdapter::getByName(const OUString& Name)
     throw( NoSuchElementException, WrappedTargetException, RuntimeException, std::exception )
 {
-    return mxObjNameAccess->getByName( Name );
+    return getXNameAccess()->getByName( Name );
 }
 
 Sequence< OUString > ImplIntrospectionAdapter::getElementNames()
     throw( RuntimeException, std::exception )
 {
-    return mxObjNameAccess->getElementNames();
+    return getXNameAccess()->getElementNames();
 }
 
 sal_Bool ImplIntrospectionAdapter::hasByName(const OUString& Name)
     throw( RuntimeException, std::exception )
 {
-    return mxObjNameAccess->hasByName( Name );
+    return getXNameAccess()->hasByName( Name );
 }
 
 // Methoden von XNameContainer
 void ImplIntrospectionAdapter::insertByName(const OUString& Name, const Any& Element)
     throw( IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException, std::exception )
 {
-    mxObjNameContainer->insertByName( Name, Element );
+    getXNameContainer()->insertByName( Name, Element );
 }
 
 void ImplIntrospectionAdapter::replaceByName(const OUString& Name, const Any& Element)
     throw( IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException, std::exception )
 {
-    mxObjNameContainer->replaceByName( Name, Element );
+    getXNameContainer()->replaceByName( Name, Element );
 }
 
 void ImplIntrospectionAdapter::removeByName(const OUString& Name)
     throw( NoSuchElementException, WrappedTargetException, RuntimeException, std::exception )
 {
-    mxObjNameContainer->removeByName( Name );
+    getXNameContainer()->removeByName( Name );
 }
 
 // Methoden von XIndexAccess
 // Schon in XNameAccess: virtual Reference<XIdlClass> getElementType() const
 sal_Int32 ImplIntrospectionAdapter::getCount() throw( RuntimeException, std::exception )
 {
-    return mxObjIndexAccess->getCount();
+    return getXIndexAccess()->getCount();
 }
 
 Any ImplIntrospectionAdapter::getByIndex(sal_Int32 Index)
     throw( IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception )
 {
-    return mxObjIndexAccess->getByIndex( Index );
+    return getXIndexAccess()->getByIndex( Index );
 }
 
 // Methoden von XIndexContainer
 void ImplIntrospectionAdapter::insertByIndex(sal_Int32 Index, const Any& Element)
     throw( IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception )
 {
-    mxObjIndexContainer->insertByIndex( Index, Element );
+    getXIndexContainer()->insertByIndex( Index, Element );
 }
 
 void ImplIntrospectionAdapter::replaceByIndex(sal_Int32 Index, const Any& Element)
     throw( IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception )
 {
-    mxObjIndexContainer->replaceByIndex( Index, Element );
+    getXIndexContainer()->replaceByIndex( Index, Element );
 }
 
 void ImplIntrospectionAdapter::removeByIndex(sal_Int32 Index)
     throw( IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception )
 {
-    mxObjIndexContainer->removeByIndex( Index );
+    getXIndexContainer()->removeByIndex( Index );
 }
 
 // Methoden von XEnumerationAccess
 // Schon in XNameAccess: virtual Reference<XIdlClass> getElementType() const;
 Reference<XEnumeration> ImplIntrospectionAdapter::createEnumeration() throw( RuntimeException, std::exception )
 {
-    return mxObjEnumerationAccess->createEnumeration();
+    return getXEnumerationAccess()->createEnumeration();
 }
 
 // Methoden von XIdlArray
 void ImplIntrospectionAdapter::realloc(Any& array, sal_Int32 length)
     throw( IllegalArgumentException, RuntimeException, std::exception )
 {
-    mxObjIdlArray->realloc( array, length );
+    getXIdlArray()->realloc( array, length );
 }
 
 sal_Int32 ImplIntrospectionAdapter::getLen(const Any& array)
     throw( IllegalArgumentException, RuntimeException, std::exception )
 {
-    return mxObjIdlArray->getLen( array );
+    return getXIdlArray()->getLen( array );
 }
 
 Any ImplIntrospectionAdapter::get(const Any& array, sal_Int32 index)
     throw( IllegalArgumentException, ArrayIndexOutOfBoundsException, RuntimeException, std::exception )
 {
-    return mxObjIdlArray->get( array, index );
+    return getXIdlArray()->get( array, index );
 }
 
 void ImplIntrospectionAdapter::set(Any& array, sal_Int32 index, const Any& value)
     throw( IllegalArgumentException, ArrayIndexOutOfBoundsException, RuntimeException, std::exception )
 {
-    mxObjIdlArray->set( array, index, value );
+    getXIdlArray()->set( array, index, value );
 }
 
 
 
 //*** Implementation von ImplIntrospectionAccess ***
 
-
 // Methoden von XIntrospectionAccess
 sal_Int32 ImplIntrospectionAccess::getSuppliedMethodConcepts()
     throw( RuntimeException, std::exception )
@@ -1347,6 +1471,7 @@ Reference<XInterface> SAL_CALL ImplIntrospectionAccess::queryAdapter( const Type
 {
     // Gibt es schon einen Adapter?
     Reference< XInterface > xAdapter( maAdapter );
+
     if( !xAdapter.is() )
     {
         xAdapter = *( new ImplIntrospectionAdapter( this, maInspectedObject, mpStaticImpl ) );
@@ -1620,6 +1745,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
     Reference<XIdlClass>                xImplClass;
     Reference<XPropertySetInfo>            xPropSetInfo;
     Reference<XPropertySet>                xPropSet;
+    bool                                bHasPropertySet = false;
 
     // Look for interfaces XTypeProvider and PropertySet
     if( eType == TypeClass_INTERFACE )
@@ -1637,7 +1763,10 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
                 const Type* pTypes = SupportedTypesSeq.getConstArray();
                 for( sal_Int32 i = 0 ; i < nTypeCount ; i++ )
                 {
-                    pClasses[i] = reflection->forName(pTypes[i].getTypeName());
+                    OUString typeName( pTypes[i].getTypeName() );
+                    pClasses[i] = reflection->forName( typeName );
+                    if( !bHasPropertySet && typeName == "com.sun.star.beans.XPropertySet" )
+                        bHasPropertySet = true;
                 }
                 // TODO: Caching!
             }
@@ -1651,7 +1780,8 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
             SupportedClassSeq[0] = xImplClass;
         }
 
-        xPropSet = Reference<XPropertySet>::query( x );
+        if ( bHasPropertySet )
+            xPropSet = Reference<XPropertySet>::query( x );
         // Jetzt versuchen, das PropertySetInfo zu bekommen
         if( xPropSet.is() )
             xPropSetInfo = xPropSet->getPropertySetInfo();
@@ -1660,7 +1790,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
     }
 
     if (xTypeProvider.is()) {
-        TypeKey key(xPropSetInfo, xTypeProvider->getTypes());
+        TypeKey key(xPropSetInfo, SupportedTypesSeq);
 
         osl::MutexGuard g(m_aMutex);
         if (rBHelper.bDisposed || rBHelper.bInDispose) {
@@ -1700,6 +1830,8 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
     if( !pAccess.is() )
         pAccess = new IntrospectionAccessStatic_Impl( reflection );
 
+    pAccess->mbPropertySet = bHasPropertySet;
+
     // Referenzen auf wichtige Daten von pAccess
     sal_Int32& rPropCount = pAccess->mnPropCount;
     IntrospectionNameMap& rPropNameMap = pAccess->maPropertyNameMap;
@@ -1949,22 +2081,43 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
                             rMethodConcept_i |= ( NAMECONTAINER  |
                                                   INDEXCONTAINER |
                                                   ENUMERATION );
+                            pAccess->mbElementAccess = true;
                         } else if ((className
-                                    == "com.sun.star.container.XNameContainer")
-                                   || (className
-                                       == "com.sun.star.container.XNameAccess"))
+                                    == "com.sun.star.container.XNameContainer"))
                         {
                             rMethodConcept_i |= NAMECONTAINER;
+                            pAccess->mbNameContainer = true;
+                            pAccess->mbNameAccess = true;
+                            pAccess->mbElementAccess = true;
                         } else if ((className
-                                    == "com.sun.star.container.XIndexContainer")
-                                   || (className
-                                       == "com.sun.star.container.XIndexAccess"))
+                                    == "com.sun.star.container.XNameAccess"))
+                        {
+                            rMethodConcept_i |= NAMECONTAINER;
+                            pAccess->mbNameAccess = true;
+                            pAccess->mbElementAccess = true;
+                        } else if ((className
+                                    == "com.sun.star.container.XIndexContainer"))
                         {
                             rMethodConcept_i |= INDEXCONTAINER;
+                            pAccess->mbIndexContainer = true;
+                            pAccess->mbIndexAccess = true;
+                            pAccess->mbElementAccess = true;
+                        } else if ((className
+                                    == "com.sun.star.container.XIndexAccess"))
+                        {
+                            rMethodConcept_i |= INDEXCONTAINER;
+                            pAccess->mbIndexAccess = true;
+                            pAccess->mbElementAccess = true;
                         } else if (className
                                    == "com.sun.star.container.XEnumerationAccess")
                         {
                             rMethodConcept_i |= ENUMERATION;
+                            pAccess->mbEnumerationAccess = true;
+                            pAccess->mbElementAccess = true;
+                        } else if (className
+                                   == "com.sun.star.reflection.XIdlArray")
+                        {
+                            pAccess->mbIdlArray = true;
                         }
 
                         // Wenn der Name zu kurz ist, wird's sowieso nichts
commit b3e645cde951906d883f015d342f85fc0eedb2ec
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Jul 8 16:36:28 2015 +0200

    vcl rendercontext: fix off-by-one error in PaintHelper::PaintBuffer()
    
    With this, Writer no longer has leftover 1-pixel-width/height lines on
    scrolling at the right/bottom of the SwEditWin area.
    
    The problem was that PaintBuffer() painted one less row/column of pixels
    than intended. This happened because Rectangle::GetSize() uses
    GetWidth() and GetHeight(), which return "bound2 - bound1 + 1", but
    because the map mode was in twips, the +1 had no effect.
    
    For example, if top=127 and bottom=762 in pixels, then the needed height
    is 636, but (assuming e.g. 96 DPI) counting 11430-1905+1 in twips, then
    converting to pixels is only 635, so the last row/column is not painted.
    
    Fix the problem by making sure that GetSize() is invoked on a rectangle
    that has the size in pixels, that's how e.g.
    SdrPreRenderDevice::OutputPreRenderDevice() uses DrawOutDev(), too.
    
    Change-Id: I6f8686e0a91ba402db93982c25be76992c260abe

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index c8efe72..a47c042 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -182,7 +182,19 @@ void PaintHelper::PaintBuffer()
         m_pWindow->SetMapMode(m_aPaintRectMapMode);
         m_pBuffer->SetMapMode(m_aPaintRectMapMode);
 
-        m_pWindow->DrawOutDev(m_aPaintRect.TopLeft(), m_aPaintRect.GetSize(), m_aPaintRect.TopLeft(), m_aPaintRect.GetSize(), *m_pBuffer.get());
+        // Make sure that the +1 value GetSize() adds to the size is in pixels.
+        Size aPaintRectSize;
+        if (m_pWindow->GetMapMode().GetMapUnit() == MAP_PIXEL)
+        {
+            aPaintRectSize = m_aPaintRect.GetSize();
+        }
+        else
+        {
+            Rectangle aRectanglePixel = m_pWindow->LogicToPixel(m_aPaintRect);
+            aPaintRectSize = m_pWindow->PixelToLogic(aRectanglePixel.GetSize());
+        }
+
+        m_pWindow->DrawOutDev(m_aPaintRect.TopLeft(), aPaintRectSize, m_aPaintRect.TopLeft(), aPaintRectSize, *m_pBuffer.get());
     }
 }
 
commit c3c6bf235af32781e83d4fed2867a16bfeafa659
Author: Ashod Nakashian <ashodnakashian at yahoo.com>
Date:   Wed Jul 8 08:37:23 2015 -0400

    Limit the font preview text length.
    
    When text is selected, the preview text is the first TEXT_WIDTH (80)
    characters of the selection rounded up to the next word.
    
    However when no word boundary is found, the preview text is as long
    as the selection, which causes the preview to be less than usable
    in some extreme cases.
    
    This patch is to limit the preview text length when no word boundary
    is found, thereby always resulting in predictable behavior.
    
    Change-Id: I8a21638d601714db956b9b160664dfe1e5e49a4a
    Reviewed-on: https://gerrit.libreoffice.org/16855
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 2767bb7..2fce458 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -712,9 +712,11 @@ void SvxFontPrevWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangl
 
             if (pImpl->maText.getLength() > (TEXT_WIDTH - 1))
             {
-                sal_Int32 nSpaceIdx = pImpl->maText.indexOf(" ", TEXT_WIDTH);
+                const sal_Int32 nSpaceIdx = pImpl->maText.indexOf(" ", TEXT_WIDTH);
                 if (nSpaceIdx != -1)
                     pImpl->maText = pImpl->maText.copy(0, nSpaceIdx);
+                else
+                    pImpl->maText = pImpl->maText.copy(0, (TEXT_WIDTH - 1));
             }
         }
 


More information about the Libreoffice-commits mailing list