sc/source/core/tool/interpr2.cxx |   18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

New commits:
commit 28d0e255e231639c4d79f6dedbe972d6daeae7f0
Author: Markus Mohrhard <markus.mohrh...@googlemail.com>
Date:   Sun Apr 10 16:29:47 2016 +0200

    tdf#94429, tdf#92198, tdf#95233: STYLE in conditional formatting
    
    This is only a quick ugly hack and not a real fix. Basically we need to
    prevent either using STYLE with more than one parameter in conditional
    formatting functions or forbid the usage of STYLE completely.
    
    In some way the usage of STYLE in conditional formatting means that our
    current conditional formatting is not yet perfect. STYLE inside of a
    conditional format is just insane from an evaluation perspective.
    
    Change-Id: Ia1cc8c8cc8f00c8d4a055b1c2d128de3e1f8e4fa

diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 2a481d1..18fd2bb 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -45,6 +45,7 @@
 #include "postit.hxx"
 #include "tokenarray.hxx"
 #include "globalnames.hxx"
+#include "stlsheet.hxx"
 
 #include <com/sun/star/sheet/DataPilotFieldFilter.hpp>
 
@@ -2386,10 +2387,21 @@ void ScInterpreter::ScStyle()
             if (pShell)
             {
                 // notify object shell directly!
+                bool bNotify = true;
+                if (aStyle2.isEmpty())
+                {
+                    const ScStyleSheet* pStyle = pDok->GetStyle(aPos.Col(), 
aPos.Row(), aPos.Tab());
+
+                    if (pStyle && pStyle->GetName() == aStyle1)
+                        bNotify = false;
+                }
 
-                ScRange aRange(aPos);
-                ScAutoStyleHint aHint( aRange, aStyle1, nTimeOut, aStyle2 );
-                pShell->Broadcast( aHint );
+                if (bNotify)
+                {
+                    ScRange aRange(aPos);
+                    ScAutoStyleHint aHint( aRange, aStyle1, nTimeOut, aStyle2 
);
+                    pShell->Broadcast( aHint );
+                }
             }
         }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to