[Libreoffice-commits] core.git: scripting/source

2018-04-27 Thread Laurent Godard
 scripting/source/pyprov/pythonscript.py |   24 +---
 1 file changed, 13 insertions(+), 11 deletions(-)

New commits:
commit 3d97c9d292d80cb82391bdb416a9c6217a8e16e4
Author: Laurent Godard <laurent.god...@cncc.fr>
Date:   Wed Apr 25 15:49:21 2018 +0200

tdf#117202 more pythonic and allow spaces as argument

space argument must be encapsulated in double-quotes
that will be stripped

Change-Id: I0387cc7f3fcb4cc48c5a94afcd481306bb4644e2
Reviewed-on: https://gerrit.libreoffice.org/53453
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/scripting/source/pyprov/pythonscript.py 
b/scripting/source/pyprov/pythonscript.py
index 5844ebe8912c..b1ef0aa7e324 100644
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -869,10 +869,8 @@ class PythonScript( unohelper.Base, XScript ):
 def __init__( self, func, mod, args ):
 self.func = func
 self.mod = mod
-if (args != '' and args is not None):
-self.args = tuple([x.strip() for x in args.split(",")])
-else:
-self.args = None
+self.args = args
+
 def invoke(self, args, out, outindex ):
 log.debug( "PythonScript.invoke " + str( args ) )
 try:
@@ -986,19 +984,23 @@ class PythonScriptProvider( unohelper.Base, XBrowseNode, 
XScriptProvider, XNameC
 def getType( self ):
 return self.dirBrowseNode.getType()
 
-# retrieve function args in parenthesis
+# retreive function args in parenthesis
 def getFunctionArguments(self, func_signature):
-nOpenParenthesis = func_signature.find( "(")
+nOpenParenthesis = func_signature.find( "(" )
 if -1 == nOpenParenthesis:
 function_name = func_signature
-arguments = ''
+arguments = None
 else:
 function_name = func_signature[0:nOpenParenthesis]
-leading = func_signature[nOpenParenthesis+1:len(func_signature)]
-nCloseParenthesis = leading.find( ")")
+arg_part = func_signature[nOpenParenthesis+1:len(func_signature)]
+nCloseParenthesis = arg_part.find( ")" )
 if -1 == nCloseParenthesis:
 raise IllegalArgumentException( "PythonLoader: mismatch 
parenthesis " + func_signature, self, 0 )
-arguments = leading[0:nCloseParenthesis]
+arguments = arg_part[0:nCloseParenthesis].strip()
+if arguments == "":
+arguments = None
+else:
+arguments = tuple([x.strip().strip('"') for x in 
arguments.split(",")])
 return function_name, arguments
 
 def getScript( self, scriptUri ):
@@ -1011,7 +1013,7 @@ class PythonScriptProvider( unohelper.Base, XBrowseNode, 
XScriptProvider, XNameC
 fileUri = storageUri[0:storageUri.find( "$" )]
 funcName = storageUri[storageUri.find( "$" )+1:len(storageUri)]
 
-# retrieve arguments in parenthesis
+# retreive arguments in parenthesis
 funcName, funcArgs = self.getFunctionArguments(funcName)
 log.debug( " getScript : parsed funcname " + str(funcName) )
 log.debug( " getScript : func args " + str(funcArgs) )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: scripting/source

2018-04-24 Thread Laurent Godard
 scripting/source/pyprov/pythonscript.py |   34 
 1 file changed, 30 insertions(+), 4 deletions(-)

New commits:
commit aa45e2745f14c5626fe163939dc7d101efe9d1cd
Author: Laurent Godard <laurent.god...@cncc.fr>
Date:   Tue Apr 24 16:05:18 2018 +0200

tdf#117202 - parse function name to get arguments

they are then aggregated to the other and passed to the function

Change-Id: I158a747de9c22d50716fc066074a593b4928d6bf
Reviewed-on: https://gerrit.libreoffice.org/53424
Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>
Tested-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/scripting/source/pyprov/pythonscript.py 
b/scripting/source/pyprov/pythonscript.py
index ef131b3c1dab..5844ebe8912c 100644
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -743,7 +743,7 @@ class DummyProgressHandler( unohelper.Base, 
XProgressHandler ):
 
 def push( self,status ):
 log.debug( "pythonscript: DummyProgressHandler.push " + str( status ) )
-def update( self,status ): 
+def update( self,status ):
 log.debug( "pythonscript: DummyProgressHandler.update " + str( status 
) )
 def pop( self, event ):
 log.debug( "pythonscript: DummyProgressHandler.push " + str( event ) )
@@ -866,12 +866,18 @@ class PackageBrowseNode( unohelper.Base, XBrowseNode ):
 
 
 class PythonScript( unohelper.Base, XScript ):
-def __init__( self, func, mod ):
+def __init__( self, func, mod, args ):
 self.func = func
 self.mod = mod
+if (args != '' and args is not None):
+self.args = tuple([x.strip() for x in args.split(",")])
+else:
+self.args = None
 def invoke(self, args, out, outindex ):
 log.debug( "PythonScript.invoke " + str( args ) )
 try:
+if (self.args):
+args += self.args
 ret = self.func( *args )
 except UnoException as e:
 # UNO Exception continue to fly ...
@@ -883,7 +889,7 @@ class PythonScript( unohelper.Base, XScript ):
 # some people may beat me up for modifying the exception text,
 # but otherwise office just shows
 # the type name and message text with no more information,
-# this is really bad for most users. 
+# this is really bad for most users.
 e.Message = e.Message + " (" + complete + ")"
 raise
 except Exception as e:
@@ -980,6 +986,21 @@ class PythonScriptProvider( unohelper.Base, XBrowseNode, 
XScriptProvider, XNameC
 def getType( self ):
 return self.dirBrowseNode.getType()
 
+# retrieve function args in parenthesis
+def getFunctionArguments(self, func_signature):
+nOpenParenthesis = func_signature.find( "(")
+if -1 == nOpenParenthesis:
+function_name = func_signature
+arguments = ''
+else:
+function_name = func_signature[0:nOpenParenthesis]
+leading = func_signature[nOpenParenthesis+1:len(func_signature)]
+nCloseParenthesis = leading.find( ")")
+if -1 == nCloseParenthesis:
+raise IllegalArgumentException( "PythonLoader: mismatch 
parenthesis " + func_signature, self, 0 )
+arguments = leading[0:nCloseParenthesis]
+return function_name, arguments
+
 def getScript( self, scriptUri ):
 try:
 log.debug( "getScript " + scriptUri + " invoked")
@@ -990,13 +1011,18 @@ class PythonScriptProvider( unohelper.Base, XBrowseNode, 
XScriptProvider, XNameC
 fileUri = storageUri[0:storageUri.find( "$" )]
 funcName = storageUri[storageUri.find( "$" )+1:len(storageUri)]
 
+# retrieve arguments in parenthesis
+funcName, funcArgs = self.getFunctionArguments(funcName)
+log.debug( " getScript : parsed funcname " + str(funcName) )
+log.debug( " getScript : func args " + str(funcArgs) )
+
 mod = self.provCtx.getModuleByUrl( fileUri )
 log.debug( " got mod " + str(mod) )
 
 func = mod.__dict__[ funcName ]
 
 log.debug( "got func " + str( func ) )
-return PythonScript( func, mod )
+return PythonScript( func, mod, funcArgs )
 except:
 text = lastException2String()
 log.error( text )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: scripting/README

2018-04-24 Thread Laurent Godard
 scripting/README |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 0e6999edba35119b051dd0f4e64365ac7dc3f209
Author: Laurent Godard <laurent.god...@cncc.fr>
Date:   Tue Apr 24 16:12:47 2018 +0200

pyprov is not deprecated

Change-Id: I6e7af6e6178f3820a73bae6008d8046161a0d8a5
Reviewed-on: https://gerrit.libreoffice.org/53425
Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>
Tested-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/scripting/README b/scripting/README
index 1ca4fe97bdd9..ba9a1677597d 100644
--- a/scripting/README
+++ b/scripting/README
@@ -34,6 +34,10 @@ C++ implementation of the LanguageScriptProvider UNO service 
for Basic
 C++ implementation of the DialogProvider UNO service used for loading
 UNO dialogs from various languages
 
+- source/pyprov
+
+LanguageScriptProvider for Python
+
 - java/com/sun/star/script/framework/provider
 
 Implementation of an abstract base class ScriptProvider which provides
@@ -62,7 +66,3 @@ Example scripts in BeanShell, JavaScript, Java and Python
 - java/org/openoffice/*
 
 Support for developing scripts in IDEs such as NetBeans.
-
-- source/pyprov
-
-LanguageScriptProvider for Python
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'private/lgodard/tdf#117202'

2018-04-24 Thread Laurent Godard
New branch 'private/lgodard/tdf#117202' available with the following commits:
commit 7930c598796f56623bbddb988977823809b0ab31
Author: Laurent Godard <laurent.god...@cncc.fr>
Date:   Tue Apr 24 16:12:47 2018 +0200

pyprov is not deprecated

Change-Id: I6e7af6e6178f3820a73bae6008d8046161a0d8a5

commit 2f3a64081418db291f5dc9eb67aac23066f09b54
Author: Laurent Godard <laurent.god...@cncc.fr>
Date:   Tue Apr 24 16:05:18 2018 +0200

tdf#117202 - parse function name to get arguments

they are then aggregated to the other and passed to the function

Change-Id: I158a747de9c22d50716fc066074a593b4928d6bf

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: Handling the sidbar with API and macro's

2016-05-03 Thread Laurent Godard

Hi Fernand

As i already sent yout, you may find all needed code samples there
http://api.libreoffice.org/examples/python/toolpanel/

just design your sidebar as a normal basic dialog
then, bind it to a pyUNO class

HTH

Laurent
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: include/sfx2 sfx2/source

2015-11-20 Thread Laurent Godard
 include/sfx2/sidebar/ContextList.hxx   |2 
 include/sfx2/sidebar/Deck.hxx  |1 
 include/sfx2/sidebar/DeckDescriptor.hxx|2 
 include/sfx2/sidebar/PanelDescriptor.hxx   |2 
 include/sfx2/sidebar/ResourceManager.hxx   |   35 +---
 include/sfx2/sidebar/SidebarController.hxx |6 
 sfx2/source/sidebar/ResourceManager.cxx|  252 ++---
 sfx2/source/sidebar/SidebarController.cxx  |  229 --
 sfx2/source/sidebar/TabBar.cxx |   14 +
 sfx2/source/sidebar/UnoDeck.cxx|   62 +--
 sfx2/source/sidebar/UnoPanel.cxx   |   64 +--
 11 files changed, 436 insertions(+), 233 deletions(-)

New commits:
commit 536c259cb9644971d0eb0cdfb7d823c5383a5481
Author: Laurent Godard <lgodard.li...@laposte.net>
Date:   Tue Aug 25 16:38:43 2015 +0200

tdf#67770 store sidebar elements states

deck & panel states at user registry level
when disposing a sidebar

if a shared deck (with "any" context application) is modified,
it apply to all applications (eg. Gallery between calc and writer); TODO ?

clean ResourceManager Get/Set const/non-const

add panels when deck is created & refactoring

* macro example

Sub Main

controller = thisComponent.currentcontroller
sidebar = thisComponent.currentcontroller.getSidebar()

sidebar.setVisible(true)

decks = sidebar.getdecks()
deck = decks.getByName("PropertyDeck")

deck.activate(true)
deck.setTitle("new deck title")
deck.moveLast()

panels = deck.getPanels()
panel = panels.getByName("TextPropertyPanel")

panel.setTitle("new panel title")
panel.expand(true) ' expand and collapse other
panel.moveLast()

End Sub

Change-Id: I2552000af92a366ebb51a479962a094b72e400b6
Reviewed-on: https://gerrit.libreoffice.org/17992
Reviewed-by: Katarina Behrens <katarina.behr...@cib.de>
Tested-by: Katarina Behrens <katarina.behr...@cib.de>

diff --git a/include/sfx2/sidebar/ContextList.hxx 
b/include/sfx2/sidebar/ContextList.hxx
index 7ce63ee..9c56d15 100644
--- a/include/sfx2/sidebar/ContextList.hxx
+++ b/include/sfx2/sidebar/ContextList.hxx
@@ -55,6 +55,8 @@ public:
 const bool bIsInitiallyVisible,
 const ::rtl::OUString& rsMenuCommand);
 
+const ::std::vector& GetEntries() const {return maEntries;};
+
 private:
 ::std::vector maEntries;
 
diff --git a/include/sfx2/sidebar/Deck.hxx b/include/sfx2/sidebar/Deck.hxx
index 0057c72..aa13d43 100644
--- a/include/sfx2/sidebar/Deck.hxx
+++ b/include/sfx2/sidebar/Deck.hxx
@@ -94,6 +94,7 @@ private:
 
 DECL_LINK_TYPED(HandleVerticalScrollBarChange, ScrollBar*, void);
 bool ProcessWheelEvent(CommandEvent* pCommandEvent);
+
 };
 
 } } // end of namespace sfx2::sidebar
diff --git a/include/sfx2/sidebar/DeckDescriptor.hxx 
b/include/sfx2/sidebar/DeckDescriptor.hxx
index f3e7cd6..8c1b9ef 100644
--- a/include/sfx2/sidebar/DeckDescriptor.hxx
+++ b/include/sfx2/sidebar/DeckDescriptor.hxx
@@ -42,6 +42,8 @@ public:
 sal_Int32 mnOrderIndex;
 bool mbExperimental;
 
+OUString msNodeName; // some impress deck nodes names are different from 
their Id
+
 VclPtr mpDeck;
 
 DeckDescriptor();
diff --git a/include/sfx2/sidebar/PanelDescriptor.hxx 
b/include/sfx2/sidebar/PanelDescriptor.hxx
index 1578bfd..2e1abb2 100644
--- a/include/sfx2/sidebar/PanelDescriptor.hxx
+++ b/include/sfx2/sidebar/PanelDescriptor.hxx
@@ -41,6 +41,8 @@ public:
 bool mbWantsCanvas;
 bool mbExperimental;
 
+OUString msNodeName; // some impress panel nodes names are different from 
their Id
+
 PanelDescriptor();
 PanelDescriptor (const PanelDescriptor& rPanelDescriptor);
 ~PanelDescriptor();
diff --git a/include/sfx2/sidebar/ResourceManager.hxx 
b/include/sfx2/sidebar/ResourceManager.hxx
index bd69b9e..9a86bc0 100644
--- a/include/sfx2/sidebar/ResourceManager.hxx
+++ b/include/sfx2/sidebar/ResourceManager.hxx
@@ -43,30 +43,18 @@ public:
  ResourceManager();
 ~ResourceManager();
 
-static ResourceManager& Instance();
-
 const DeckDescriptor* GetDeckDescriptor(const OUString& rsDeckId) const;
-const PanelDescriptor* GetPanelDescriptor(const OUString& rsPanelId) const;
-
-/** Excluded or include a deck from being displayed in the tab
-bar.
-Note that this value is not persistent.
-The flag can not be set directly at a DeckDescriptor object
-because the ResourceManager gives access to them only
-read-only.
-*/
-void SetIsDeckEnabled(const OUString& rsDeckId, const bool bIsEnabled);
-
-void SetDeckTitle(const OUString& rsDeckId, const OUString& sTitle);
-
-void SetDeckToDescriptor(const OUString& rsDeckId, VclPtr aDeck);
+DeckDescriptor* GetDeckDescriptor(const OU

[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - basic/source sc/qa

2015-10-01 Thread Laurent Godard
 basic/source/classes/sbxmod.cxx |   44 +---
 basic/source/inc/filefmt.hxx|3 +
 sc/qa/extras/macros-test.cxx|   26 +-
 sc/qa/extras/testdocuments/testTypePassword.ods |binary
 4 files changed, 66 insertions(+), 7 deletions(-)

New commits:
commit db17079fcff6f9a068c499b17f2501cc4c82d10b
Author: Laurent Godard <lgodard.li...@laposte.net>
Date:   Fri Sep 18 17:06:29 2015 +0200

tdf#94617 allow to store nStart information greater than sal_Int16 limit

- preserve backward compatibility
- nDebugFlag is stored but not used when loaded
- Flag nDebugFlag set the top bit to 1
- stores the multiplier of sal_Int16 limit to reach nStart
- in load, test this flag bit
- rebuild correct nStart
- new B_CURVERSION file format for binary storage macro
- unit test for big modules

Change-Id: Iaa037982d828fef7195615e6eda546b7199a4fe8
Reviewed-on: https://gerrit.libreoffice.org/18926
Reviewed-by: Caolán McNamara <caol...@redhat.com>
Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index aaa9db9..d025cf0 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -77,6 +77,8 @@
 #include "sbxmod.hxx"
 #include "parser.hxx"
 
+#include 
+
 using namespace com::sun::star;
 using namespace com::sun::star::lang;
 using namespace com::sun::star::reflection;
@@ -1068,6 +1070,7 @@ void SbModule::SetVBACompat( bool bCompat )
 void SbModule::Run( SbMethod* pMeth )
 {
 SAL_INFO("basic","About to run " << OUStringToOString( pMeth->GetName(), 
RTL_TEXTENCODING_UTF8 ).getStr() << ", vba compatmode is " << mbVBACompat );
+
 static sal_uInt16 nMaxCallLevel = 0;
 
 bool bDelInst = ( GetSbData()->pInst == NULL );
@@ -1175,7 +1178,9 @@ void SbModule::Run( SbMethod* pMeth )
 {
 GetSbData()->pInst->EnableCompatibility( true );
 }
+
 while( pRt->Step() ) {}
+
 if( pRt->pNext )
 pRt->pNext->unblock();
 
@@ -2035,14 +2040,35 @@ bool SbMethod::LoadData( SvStream& rStrm, sal_uInt16 
nVer )
 {
 if( !SbxMethod::LoadData( rStrm, 1 ) )
 return false;
-sal_Int16 n;
-rStrm.ReadInt16( n );
+
+sal_uInt16 nFlag;
+rStrm.ReadUInt16( nFlag );
+
 sal_Int16 nTempStart = (sal_Int16)nStart;
+
 if( nVer == 2 )
+{
 rStrm.ReadUInt16( nLine1 ).ReadUInt16( nLine2 ).ReadInt16( nTempStart 
).ReadCharAsBool( bInvalid );
+//tdf#94617
+if (nFlag & 0x8000)
+{
+sal_uInt16 nMult = nFlag & 0x7FFF;
+sal_Int16 nMax = std::numeric_limits::max();
+nStart = nMult * nMax + nTempStart;
+}
+else
+{
+nStart = nTempStart;
+}
+}
+else
+{
+nStart = nTempStart;
+}
+
 // HACK ue to 'Referenz could not be saved'
 SetFlag( SBX_NO_MODIFY );
-nStart = nTempStart;
+
 return true;
 }
 
@@ -2050,11 +2076,19 @@ bool SbMethod::StoreData( SvStream& rStrm ) const
 {
 if( !SbxMethod::StoreData( rStrm ) )
 return false;
-rStrm.WriteInt16( nDebugFlags )
+
+//tdf#94617
+sal_Int16 nMax = std::numeric_limits::max();
+sal_Int16 nStartTemp = nStart % nMax;
+sal_uInt16 nDebugFlagsTemp = nStart / nMax;
+nDebugFlagsTemp |= 0x8000;
+
+rStrm.WriteUInt16( nDebugFlagsTemp )
  .WriteInt16( nLine1 )
  .WriteInt16( nLine2 )
- .WriteInt16( nStart )
+ .WriteInt16( nStartTemp )
  .WriteBool( bInvalid );
+
 return true;
 }
 
diff --git a/basic/source/inc/filefmt.hxx b/basic/source/inc/filefmt.hxx
index db0b1f6..c9d6ba7 100644
--- a/basic/source/inc/filefmt.hxx
+++ b/basic/source/inc/filefmt.hxx
@@ -40,11 +40,12 @@ class SvStream;
 // Version 11: #29955 force anew compilation because of build-inconsistences
 // Version 12: aoo#64377 increase code size that basic can handle
 // tdf#75973 support user defined types B_USERTYPES in password 
protected macros
+// Version 13: tdf#94617 store methods nStart information greater than 
sal_Int16 limit
 //
 
 #define B_LEGACYVERSION 0x0011L
 #define B_EXT_IMG_VERSION 0x0012L
-#define B_CURVERSION 0x0012L
+#define B_CURVERSION 0x0013L
 
 // The file contains either a module- or a library-record.
 // Those records contain further records. Every record's got
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index 745de86..2aa682f 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -118,13 +118,37 @@ void ScMacrosTest::testPasswordProtectedStarBasic()
 ScDocShell* xDocSh = static_cast<ScDocShell*>(pFoundShell);
 ScDocument& rDoc = xDocSh->GetDocument();
 

[Libreoffice-commits] core.git: officecfg/registry sfx2/PythonTest_sfx2_python.mk sfx2/qa

2015-09-15 Thread Laurent Godard
 officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu |  100 +--
 sfx2/PythonTest_sfx2_python.mk   |1 
 sfx2/qa/python/check_sidebar_registry.py |   92 ++
 3 files changed, 143 insertions(+), 50 deletions(-)

New commits:
commit d38e743e8eb3fa70faf194c25dea1893029c5460
Author: Laurent Godard <lgodard.li...@laposte.net>
Date:   Mon Sep 14 15:58:37 2015 +0200

Rename Sidebar.xcu node names to be meaningful

+ prefixe with Sd, Sw, Sc if only one application context, no prefix 
otherwise
+ uniformize implicit convention nodeName = Id
+ unit test
  + check nodeName/Id
  + panels are bound to existing deck

Change-Id: I4ccc39008ebf5b5820d09472abfd45d2813e8c96
Reviewed-on: https://gerrit.libreoffice.org/18570
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
index 6bac7d7..0a5514c 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
@@ -61,12 +61,12 @@
 
   
 
-  
+  
 
   Master Pages
 
 
-  MasterPagesDeck
+  SdMasterPagesDeck
 
 
   
private:graphicrepository/sfx2/res/symphony/sidebar-template-large.png
@@ -81,12 +81,12 @@
 
   
 
-  
+  
 
   Custom Animation
 
 
-  CustomAnimationDeck
+  SdCustomAnimationDeck
 
 
   
private:graphicrepository/sfx2/res/symphony/sidebar-animation-large.png
@@ -101,12 +101,12 @@
 
   
 
-  
+  
 
   Slide Transition
 
 
-  SlideTransitionDeck
+  SdSlideTransitionDeck
 
 
   
private:graphicrepository/sfx2/res/symphony/sidebar-transition-large.png
@@ -161,12 +161,12 @@
 
   
 
-  
+  
 
   Functions
 
 
-  FunctionsDeck
+  ScFunctionsDeck
 
 
   
private:graphicrepository/sfx2/res/symphony/sidebar-functions-large.png
@@ -181,12 +181,12 @@
 
   
 
-  
+  
 
   Manage Changes
 
 
-  ManageChangesDeck
+  SwManageChangesDeck
 
 
   private:graphicrepository/cmd/lc_trackchangesbar.png
@@ -208,12 +208,12 @@
 
   
 
-  
+  
 
   Design
 
 
-  DesignDeck
+  SwDesignDeck
 
 
   private:graphicrepository/cmd/lc_designerdialog.png
@@ -558,7 +558,7 @@
 
   
 
-  
+  
 
   Layouts
 
@@ -566,7 +566,7 @@
   false
 
 
-  ImpressLayoutsPanel
+  SdLayoutsPanel
 
 
   PropertyDeck
@@ -588,7 +588,7 @@
 
   
 
-  
+  
 
   Used in This Presentation
 
@@ -596,10 +596,10 @@
   false
 
 
-  UsedMasterPagesPanel
+  SdUsedMasterPagesPanel
 
 
-  MasterPagesDeck
+  SdMasterPagesDeck
 
 
   
@@ -614,7 +614,7 @@
 
   
 
-  
+  
 
   Recently Used
 
@@ -622,10 +622,10 @@
   false
 
 
-  RecentMasterPagesPanel
+  SdRecentMasterPagesPanel
 
 
-  MasterPagesDeck
+  SdMasterPagesDeck
 
 
   
@@ -640,7 +640,7 @@
 
   
 
-  
+  
 
   Available for Use
 
@@ -648,10 +648,10 @@
   false
 
 
-  AllMasterPagesPanel
+  SdAllMasterPagesPanel
 
 
-  MasterPagesDeck
+  SdMasterPagesDeck
 
 
   
@@ -666,7 +666,7 @@
 
   
 
-  
+  
 
   Custom Animation
 
@@ -674,10 +674,10 @@
   true
 
 
-  CustomAnimationPanel
+  SdCustomAnimationPanel
 
 
-  CustomAnimationDeck
+  SdCustomAnimationDeck
 
 
   
@@ -692,7 +692,7 @@
 
   
 
-  
+  
 
   Slide Transition
 
@@ -700,10 +700,10 @@
   true
 
 
-  SlideTransitionPanel
+  SdSlideTransitionPanel
 
 
-  SlideTransitionDeck
+  SdSlideTransitionDeck
 
 
   
@@ -718,7 +718,7 @@
 
   
 
-  
+  
 
   Table Design
 
@@ -726,7 +726,7 @@
   false
 
 
-  Impre

[Libreoffice-commits] core.git: sfx2/qa

2015-09-02 Thread Laurent Godard
 sfx2/qa/python/check_sidebar.py |   33 -
 1 file changed, 28 insertions(+), 5 deletions(-)

New commits:
commit c94a1fdc4443e11d19d12acd8883f9b9494e
Author: Laurent Godard <lgodard.li...@laposte.net>
Date:   Tue Sep 1 15:28:39 2015 +0200

sideber uno api test less dependant to panels order

Change-Id: I3a4ef006becbce70897505a6f3367c4b004e13b0
Reviewed-on: https://gerrit.libreoffice.org/18239
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>
Tested-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sfx2/qa/python/check_sidebar.py b/sfx2/qa/python/check_sidebar.py
index 26a76bd..7599e4d 100644
--- a/sfx2/qa/python/check_sidebar.py
+++ b/sfx2/qa/python/check_sidebar.py
@@ -96,7 +96,7 @@ class CheckSidebar(unittest.TestCase):
 panelsCount = xPanels.getCount()
 self.assertEqual ( panelsCount, 5 )
 
-firstPanelName = "StylesPropertyPanel"
+firstPanelName = self.getFirstPanel(xPanels)
 
 panelElementNames = xPanels.getElementNames()
 assert ( firstPanelName in panelElementNames )
@@ -110,10 +110,7 @@ class CheckSidebar(unittest.TestCase):
 xPanel.setTitle(newTitle)
 assert ( xPanel.getTitle() == newTitle )
 
-xPanel.moveFirst()
 initialIndex = xPanel.getOrderIndex()
-assert ( initialIndex == 100 )
-
 xPanel.moveLast()
 assert ( xPanel.getOrderIndex() > initialIndex )
 
@@ -132,7 +129,9 @@ class CheckSidebar(unittest.TestCase):
 xPanel.collapse()
 assert( not xPanel.isExpanded() )
 
-otherPanel = xPanels.getByName("NumberFormatPropertyPanel")
+lastPanelName = self.getLastPanel(xPanels)
+
+otherPanel = xPanels.getByName(lastPanelName)
 otherPanel.expand(False)
 assert( otherPanel.isExpanded() )
 
@@ -143,6 +142,30 @@ class CheckSidebar(unittest.TestCase):
 # close the document
 xDoc.dispose()
 
+def getFirstPanel(self, xPanels):
+
+panelName = ""
+curIndex = 1
+
+for panel in xPanels:
+if panel.getOrderIndex() < curIndex:
+panelName = panel.getId()
+curIndex = panel.getOrderIndex()
+
+return panelName
+
+def getLastPanel(self, xPanels):
+
+panelName = ""
+curIndex = 0
+
+for panel in xPanels:
+if panel.getOrderIndex() > curIndex:
+panelName = panel.getId()
+curIndex = panel.getOrderIndex()
+
+return panelName
+
 if __name__ == "__main__":
 unittest.main()
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: basic/source include/basic sc/qa

2015-08-31 Thread Laurent Godard
 basic/source/classes/image.cxx  |6 ++--
 basic/source/classes/sbxmod.cxx |5 
 basic/source/inc/filefmt.hxx|   30 +++-
 basic/source/uno/scriptcont.cxx |5 ++--
 include/basic/sbmod.hxx |1 
 sc/qa/extras/testdocuments/testTypePassword.ods |binary
 6 files changed, 35 insertions(+), 12 deletions(-)

New commits:
commit 8a7b7b7b72c299bc9a96815814c1452be7f662c1
Author: Laurent Godard <lgodard.li...@laposte.net>
Date:   Wed Aug 19 17:58:12 2015 +0200

New identifier for save/open macro with user defined types

no version bump but B_USERTYPE defined

fix test from commit de26ef85 that should be nMaxRecords

tested full round trip on password protected document (ie. use binary 
storage)
master --(0)--> master --(1)--> libreoffice 4.4 --(2)--> master --(3)--> 
master

(0) in master, User type supported, big module supported
(1) in libreoffice 4.4, user type not supported, big module supported, no 
loss of code
(2) in master, user type not supported, big module not found, no loss of 
code
it is OK as libreoffice 4.4 saves to LegacyVersion
(3) in master, User type supported, big module supported (all is restored)
it is OK as module was saved with CURRENT_VERSION (see sbxmod.cxx)

Change-Id: I237cf7de70adf1a755be1bc30987b21c43b6ab35
Reviewed-on: https://gerrit.libreoffice.org/17871
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Caolán McNamara <caol...@redhat.com>
Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index 703dbd4..3faabae 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -240,13 +240,13 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
 }
 break;
 }
-case B_SBXOBJECTS:
+case B_USERTYPES:
 {
 //assuming an empty string with just the lead 32bit/16bit len 
indicator
 const size_t nMinStringSize = (eCharSet == 
RTL_TEXTENCODING_UNICODE) ? 4 : 2;
 const size_t nMinRecordSize = nMinStringSize + 
sizeof(sal_Int16);
 const size_t nMaxRecords = r.remainingSize() / nMinRecordSize;
-if (nCount > nMinRecordSize)
+if (nCount > nMaxRecords)
 {
 SAL_WARN("basic", "Parsing error: " << nMaxRecords <<
  " max possible entries, but " << nCount << " 
claimed, truncating");
@@ -458,7 +458,7 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
 sal_uInt16 nTypes = rTypes->Count();
 if (nTypes > 0 )
 {
-nPos = SbiOpenRecord( r, B_SBXOBJECTS, nTypes );
+nPos = SbiOpenRecord( r, B_USERTYPES, nTypes );
 
 for (sal_uInt16 i = 0; i < nTypes; i++)
 {
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 364199c..5dc17c0 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1803,11 +1803,6 @@ bool SbModule::HasExeCode()
 }
 
 // Store only image, no source
-bool SbModule::StoreBinaryData( SvStream& rStrm )
-{
-return StoreBinaryData( rStrm, 0 );
-}
-
 bool SbModule::StoreBinaryData( SvStream& rStrm, sal_uInt16 nVer )
 {
 bool bRet = Compile();
diff --git a/basic/source/inc/filefmt.hxx b/basic/source/inc/filefmt.hxx
index 9b294a8..db0b1f6 100644
--- a/basic/source/inc/filefmt.hxx
+++ b/basic/source/inc/filefmt.hxx
@@ -38,10 +38,13 @@ class SvStream;
 // Version  F: #57844 introduction of SvNumberformat::StringToDouble
 // Version 10: #29955 generate for-loop-level in Statement-PCodes
 // Version 11: #29955 force anew compilation because of build-inconsistences
+// Version 12: aoo#64377 increase code size that basic can handle
+// tdf#75973 support user defined types B_USERTYPES in password 
protected macros
+//
 
 #define B_LEGACYVERSION 0x0011L
-#define B_CURVERSION 0x0012L
 #define B_EXT_IMG_VERSION 0x0012L
+#define B_CURVERSION 0x0012L
 
 // The file contains either a module- or a library-record.
 // Those records contain further records. Every record's got
@@ -69,6 +72,9 @@ class SvStream;
 #define B_SBXOBJECTS0x5853  // SX SBX objects
 #define B_EXTSOURCE 0x5345  // ES extended source
 
+#define B_USERTYPES 0x4369  // UT user defined types
+
+
 // A library record contains only module records
 //  sal_uInt16 identifier BL
 //  sal_uInt32 the record's length
@@ -153,6 +159,28 @@ class SvStream;
 // sal_uInt16 number of objects
 //    object data
 
+// user defined types B_USERTYPES :
+//  sal_uInt16  identifier UT
+

[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - basic/source include/basic sc/qa

2015-08-31 Thread Laurent Godard
 basic/source/classes/image.cxx  |  171 
 basic/source/classes/sbxmod.cxx |5 
 basic/source/inc/filefmt.hxx|   30 
 basic/source/uno/scriptcont.cxx |5 
 include/basic/sbmod.hxx |1 
 sc/qa/extras/macros-test.cxx|   33 
 sc/qa/extras/testdocuments/testTypePassword.ods |binary
 7 files changed, 236 insertions(+), 9 deletions(-)

New commits:
commit cd91509191bee9faaabdae185fef58b811f3a5a4
Author: Laurent Godard <lgodard.li...@laposte.net>
Date:   Tue Aug 18 16:44:55 2015 +0200

tdf#75973 : User Defined Types in password encrypted macros

save/load basic script so that when executing password protected
the user defined types can be rebuilt

supports array and nested types

New identifier B_USERTYPE for save/open macro with user defined types
No version bump but saves binary format now to current_version

a unit test in sc macros-test.cxx

full round trip on password protected document (ie. use binary storage)
master --(0)--> master --(1)--> libreoffice 4.4 --(2)--> master --(3)--> 
master
(0) in master, User type supported, big module supported
(1) in libreoffice 4.4, user type not supported, big module supported, no 
loss of code
(2) in master, user type not supported, big module not found, no loss of 
code
it is OK as libreoffice 4.4 saves to LegacyVersion (see sbxmod.cxx changes)
(3) in master, User type supported, big module supported (all is restored)
it is OK as module was saved with CURRENT_VERSION (see sbxmod.cxx changes)

Change-Id: Idab5de85e948dc11f4aba631b1569a1cc1cb4bf6
Reviewed-on: https://gerrit.libreoffice.org/17841
Reviewed-by: Caolán McNamara <caol...@redhat.com>
Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index d99259b..6726da1 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -240,6 +240,99 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
 }
 break;
 }
+case B_USERTYPES:
+{
+//assuming an empty string with just the lead 32bit/16bit len 
indicator
+const size_t nMinStringSize = (eCharSet == 
RTL_TEXTENCODING_UNICODE) ? 4 : 2;
+const size_t nMinRecordSize = nMinStringSize + 
sizeof(sal_Int16);
+const size_t nMaxRecords = r.remainingSize() / nMinRecordSize;
+if (nCount > nMaxRecords)
+{
+SAL_WARN("basic", "Parsing error: " << nMaxRecords <<
+ " max possible entries, but " << nCount << " 
claimed, truncating");
+nCount = nMaxRecords;
+}
+
+// User defined types
+for (sal_uInt16 i = 0; i < nCount; i++)
+{
+OUString aTypeName = r.ReadUniOrByteString(eCharSet);
+
+sal_Int16 nTypeMembers;
+r.ReadInt16(nTypeMembers);
+
+SbxObject *pType = new SbxObject(aTypeName);
+SbxArray *pTypeMembers = pType->GetProperties();
+
+for (sal_uInt16 j = 0; j < nTypeMembers; j++)
+{
+OUString aMemberName = r.ReadUniOrByteString(eCharSet);
+
+sal_Int16 aIntMemberType;
+r.ReadInt16(aIntMemberType);
+SbxDataType aMemberType = static_cast< SbxDataType > ( 
aIntMemberType );
+
+SbxProperty *pTypeElem = new SbxProperty( aMemberName, 
aMemberType );
+
+sal_uInt32 aIntFlag;
+r.ReadUInt32(aIntFlag);
+SbxFlagBits nElemFlags = static_cast< SbxFlagBits > ( 
aIntFlag );
+
+pTypeElem->SetFlags(nElemFlags);
+
+sal_Int16 hasObject;
+r.ReadInt16(hasObject);
+
+if (hasObject == 1)
+{
+if(aMemberType == SbxOBJECT)
+{
+// nested user defined types
+// declared before use, so it is ok to 
reference it by name on load
+OUString aNestedTypeName = 
r.ReadUniOrByteString(eCharSet);
+SbxObject* pNestedTypeObj = static_cast< 
SbxObject* >( rTypes->Find( aNestedTypeName, SbxCLASS_OBJECT ) );
+if (pNestedTypeObj)
+{
+  

[Libreoffice-commits] core.git: offapi/com offapi/UnoApi_offapi.mk

2015-08-25 Thread Laurent Godard
 offapi/UnoApi_offapi.mk |   10 +-
 offapi/com/sun/star/frame/XController2.idl  |1 +
 offapi/com/sun/star/ui/XDeck.idl|6 --
 offapi/com/sun/star/ui/XDecks.idl   |7 ++-
 offapi/com/sun/star/ui/XPanel.idl   |4 +++-
 offapi/com/sun/star/ui/XPanels.idl  |9 -
 offapi/com/sun/star/ui/XSidebarProvider.idl |1 +
 7 files changed, 28 insertions(+), 10 deletions(-)

New commits:
commit c609b30b12df9118a9fb5fcf06177a39c54d895a
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Mon Aug 24 14:15:57 2015 +0200

sidebar uno api corrections

Change-Id: I1bd1040cc80c0450a5e029c37f0737c0692c056a
Reviewed-on: https://gerrit.libreoffice.org/17952
Reviewed-by: Stephan Bergmann sberg...@redhat.com
Tested-by: Stephan Bergmann sberg...@redhat.com

diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 0a915f4..505f4f5 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -4013,17 +4013,17 @@ $(eval $(call 
gb_UnoApi_add_idlfiles,offapi,com/sun/star/ui,\
XContextChangeEventMultiplexer \
XContextMenuInterception \
XContextMenuInterceptor \
+   XDeck \
+   XDecks \
XDockingAreaAcceptor \
XImageManager \
XModuleUIConfigurationManager \
XModuleUIConfigurationManager2 \
XModuleUIConfigurationManagerSupplier \
-   XSidebar \
-   XSidebarPanel \
XPanel \
XPanels \
-   XDeck \
-   XDecks \
+   XSidebar \
+   XSidebarPanel \
XSidebarProvider \
XStatusbarItem \
XToolPanel \
@@ -4036,7 +4036,7 @@ $(eval $(call 
gb_UnoApi_add_idlfiles,offapi,com/sun/star/ui,\
XUIConfigurationStorage \
XUIElement \
XUIElementFactory \
-XUIElementFactoryManager \
+   XUIElementFactoryManager \
XUIElementFactoryRegistration \
XUIElementSettings \
XUpdateModel \
diff --git a/offapi/com/sun/star/frame/XController2.idl 
b/offapi/com/sun/star/frame/XController2.idl
index 400b7ae..23c64f1 100644
--- a/offapi/com/sun/star/frame/XController2.idl
+++ b/offapi/com/sun/star/frame/XController2.idl
@@ -63,6 +63,7 @@ interface XController2 : XController
 CreationArguments;
 
 /** get the sidebar if exists
+@since LibreOffice 5.1
 */
 ::com::sun::star::ui::XSidebarProvider getSidebar();
 };
diff --git a/offapi/com/sun/star/ui/XDeck.idl b/offapi/com/sun/star/ui/XDeck.idl
index 53b7397..f19ed40 100644
--- a/offapi/com/sun/star/ui/XDeck.idl
+++ b/offapi/com/sun/star/ui/XDeck.idl
@@ -15,7 +15,9 @@
 
  module com {  module sun {  module star {  module ui {
 
-/** provides access to Desk */
+/** provides access to Deck
+@since LibreOffice 5.1
+*/
 
 interface XDeck
 
@@ -39,7 +41,7 @@ interface XDeck
 */
 boolean isActive();
 
-/** Activate the deck and isplays its content
+/** Activate the deck and displays its content
 
 @param bActivate
 The requested state for the deck
diff --git a/offapi/com/sun/star/ui/XDecks.idl 
b/offapi/com/sun/star/ui/XDecks.idl
index ba7c3a7..0ed2977 100644
--- a/offapi/com/sun/star/ui/XDecks.idl
+++ b/offapi/com/sun/star/ui/XDecks.idl
@@ -15,11 +15,16 @@
 
  module com {  module sun {  module star {  module ui {
 
-/** provides access to Desks of a Sidebar.*/
+/** provides access to Decks of a Sidebar.
+@since LibreOffice 5.1
+*/
 
 interface XDecks
 
 {
+/**
+returned ANYs are actually of type com::sun::star::ui::XDeck
+*/
 interface com::sun::star::container::XIndexAccess;
 interface com::sun::star::container::XNameAccess;
 };
diff --git a/offapi/com/sun/star/ui/XPanel.idl 
b/offapi/com/sun/star/ui/XPanel.idl
index 0070d23..f02d8b3 100644
--- a/offapi/com/sun/star/ui/XPanel.idl
+++ b/offapi/com/sun/star/ui/XPanel.idl
@@ -16,7 +16,9 @@
 
  module com {  module sun {  module star {  module ui {
 
-/** provides access to Desk */
+/** provides access to Panel
+@since LibreOffice 5.1
+*/
 
 interface XPanel
 
diff --git a/offapi/com/sun/star/ui/XPanels.idl 
b/offapi/com/sun/star/ui/XPanels.idl
index a2aa851..3617855 100644
--- a/offapi/com/sun/star/ui/XPanels.idl
+++ b/offapi/com/sun/star/ui/XPanels.idl
@@ -15,14 +15,21 @@
 
  module com {  module sun {  module star {  module ui {
 
-/** provides access to Panels of a Deck.*/
+/** provides access to Panels of a Deck.
+@since LibreOffice 5.1
+*/
 
 interface XPanels
 
 {
+/**
+returned ANYs are actually of type com::sun::star::ui::XPanel
+*/
 interface com::sun::star::container::XIndexAccess;
 interface com::sun::star::container::XNameAccess;
 
+/** The deck Id that contains the Panels
+*/
 string getDeckId();
 };
 
diff --git a/offapi/com/sun/star/ui/XSidebarProvider.idl 
b/offapi/com/sun/star/ui/XSidebarProvider.idl
index 8392bea..96dbfd8 100644
--- a/offapi/com/sun

Re: [Libreoffice-commits] core.git: new uno sidebar api tdf#91806

2015-08-24 Thread Laurent Godard

Hi stephan

Le 21/08/2015 14:46, Stephan Bergmann a écrit :

I'm sorry this is a little late.  But I think we're still fine, as this
should until now only have hit master towards LO 5.1, and not any
libreoffice-5-0 or earlier.



here are the changes
https://gerrit.libreoffice.org/#/c/17952/

i also updated
https://wiki.documentfoundation.org/ReleaseNotes/5.1#API_changes

feel free of anything has to be modified

Thanks again for your review

Laurent
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


mentoring for Sidebar customization settings

2015-08-24 Thread Laurent Godard

Hi all

I would like to have a look at
https://bugs.documentfoundation.org/show_bug.cgi?id=67770

-- CONFIGURATION: Sidebar customization settings not remembered after 
reopening


I'll first have a look at the global settings, application level based 
as they are actually loaded from the registry


Then, i would like to set this per file as a customization is highly 
dependant from the context we use it (one may need different settings on 
different files).

Any advice on this is welcommed

also any mentor volunteer to review my job and helping me on some 
starting points is welcome


thanks in advance

Laurent
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice-commits] core.git: new uno sidebar api tdf#91806

2015-08-21 Thread Laurent Godard

Hi

* about setTitle


What I mean is:  Is it supposed to be useful functionality that a client
that has access to an XDeck instance can change its title?  Or should
the title rather be immutable and attached to the XDeck instance when it
is created?

I often wonder this when I see UNO interfaces that have getter/setter
method pairs for some item of the object's internal state.  When an
object is considered as internal state plus an external set of
messages it can react to, it often does not make sense to have setter
methods for individual items of the internal state.  Nevertheless,
people are sometimes tempted to add such setters just because, and
that may lead to unnecessary problems.  That's why I'm asking.



The title is what is displayed
One can want (as uno user) to modify contextually the title
I admit this may be over engeneered regarding legacy decks and panels, 
but for custom ones deployed as extension that may be usefull (at least 
for my real life need)


* about setOrderIndex


I'm not sure I understand you here.  But if there is no real need for
client code to be able to change an XDeck's orderIndex, I'd suggest to
just not offer that functionality.  (This is similar to the above
setTitle.)


a client may want to re-order (especially) its decks
a custom deck (extension deployed) always apear at the bottom
this setOrderIndex allow to reorder the decks to the need of the 
extension developper


it is some complementary quick-to-do regarding the 
movePrevious/Next/First/Last api on decks and panels


Laurent
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice-commits] core.git: new uno sidebar api tdf#91806

2015-08-21 Thread Laurent Godard

Hi Stephan

Thanks a lot for your review


I'm sorry this is a little late.  But I think we're still fine, as this
should until now only have hit master towards LO 5.1, and not any
libreoffice-5-0 or earlier.



right

I'll correct all of your points
with (@since LibreOffice 5.1)

remarks/questions below
feel free if anything not clear

Thanks again Stephan, i'll submit a new patch and let you know

Laurent


diff --git a/offapi/com/sun/star/ui/XDeck.idl
b/offapi/com/sun/star/ui/XDeck.idl

...

+ module com {  module sun {  module star {  module ui {
+
+/** provides access to Desk */


What does the above mean?  And please add a @since tag here.



-- probably typo, it was meant Decks. Is it clearer ?



+*/
+void setTitle( [in] string newTitle );


Is setTitle necessary and/or useful?  (At least, none of the code in
this commit appears to use it.)



-- it allow changing the Deck title (as named)
-- in UnoDeck.hxx 
http://opengrok.libreoffice.org/xref/core/include/sfx2/sidebar/UnoDeck.hxx#40

-- do i miss somehing ?



+/** Activate the deck and isplays its content


Typo isplays.





+void setOrderIndex( [in] long newOrderIndex );


Is setOrderIndex necessary and/or useful? (At least, none of the code in
this commit appears to use it.)  Is setOrderIndex(0) the same as
moveFirst()?



first, have to say that only rely of existing implementation.

unfortunatelly, the Decks and panels are global to libreoffice
that means that 2 panels or desk can't have same order index (or at 
least i did not test that case regarding the existing. I may verify if 2 
panels or Decks can have same orderIndex)
setting setOrderIndex(0) as movreFirst() on one panel, the the other 
would disturb non displayed panels (even on non visible decks) or would 
require to re-arrange all the Decks/Panels each time


i personnaly do not like this architecture despite i understand the 
reusability goal. i think there are cleanir things to be done (but as a 
first round i did not want to destray all the existing structure)





+
+interface XDecks
+
+{
+interface com::sun::star::container::XIndexAccess;
+interface com::sun::star::container::XNameAccess;


The downside of reusing such generic interfaces is that it doesn't make
it clear that the returned ANYs are actually of type XDeck (I assume).
So at least document that, or, if the full set of XIndex+XNameAccess is
not really necessary and/or useful, consider replacing this with a
(handful of) more specific method(s).



XIndexAccess may not be that useful (and may be cinfusing with orderIndex)
XNameAccess is usefull
will document and may be replace XIndexAccess


+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/offapi/com/sun/star/ui/XPanel.idl
b/offapi/com/sun/star/ui/XPanel.idl
+
+ module com {  module sun {  module star {  module ui {
+
+/** provides access to Desk */


What does the above mean?  And please add a @since tag here.



typo, should read Panel


There is also css.ui.XSidebarPanel; can you clarify why there's two?



yep, will do. old API
this returns ui::XUIElement getRealInterFace() which is the panel 
graphical content, not the Panel object itself


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: basctl/source

2015-08-20 Thread Laurent Godard
 basctl/source/basicide/baside2b.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 47d1cb09e6bcf8b044d15fff1be9b76fe72524b0
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Wed Aug 19 16:15:16 2015 +0200

avoid autocorrection misreplacing

takes the last token in case of chained . instead of the first one

to avoid

aa.b.
autocorrects (wrongly) to
.

Change-Id: Ibca68850282a0d3aec67ca518bdcbf1da676e155
Reviewed-on: https://gerrit.libreoffice.org/17858
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/basctl/source/basicide/baside2b.cxx 
b/basctl/source/basicide/baside2b.cxx
index d4961d5..ca9009c 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -861,7 +861,7 @@ void EditorWindow::HandleCodeCompletion()
 if( aVect.empty() )//nothing to do
 return;
 
-OUString sBaseName = aVect[0];//variable name
+OUString sBaseName = aVect[aVect.size()-1];//variable name
 OUString sVarType = aCodeCompleteCache.GetVarType( sBaseName );
 
 if( !sVarType.isEmpty()  CodeCompleteOptions::IsAutoCorrectOn() )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: basctl/source

2015-08-18 Thread Laurent Godard
 basctl/source/basicide/baside2b.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit ddb43837ca74295b848d3217064a2442b0a12b8c
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Tue Aug 18 09:24:26 2015 +0200

avoid basic ide crash in code autocompletion

due to code completion and user defined types

type MyType
  a as string
  b as string
end type

dim aa as MyType

typing
aa.b.
the last point led to crash

remaining problem
code autocorrection now shows wrong behaviour as
aa.b.
autocorrects (wrongly) to
.

Change-Id: I3e05680cd9d82f7dc124c5923f9858e22961896e
Reviewed-on: https://gerrit.libreoffice.org/17824
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/basctl/source/basicide/baside2b.cxx 
b/basctl/source/basicide/baside2b.cxx
index d1a29ae..d4961d5 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -860,8 +860,10 @@ void EditorWindow::HandleCodeCompletion()
 
 if( aVect.empty() )//nothing to do
 return;
+
 OUString sBaseName = aVect[0];//variable name
 OUString sVarType = aCodeCompleteCache.GetVarType( sBaseName );
+
 if( !sVarType.isEmpty()  CodeCompleteOptions::IsAutoCorrectOn() )
 {//correct variable name, if autocorrection on
 const OUString sStr = aCodeCompleteCache.GetCorrectCaseVarName( 
sBaseName, GetActualSubName(nLine) );
@@ -3002,6 +3004,10 @@ std::vector OUString  
UnoTypeCodeCompletetor::GetXIdlClassFields() const
 
 bool UnoTypeCodeCompletetor::CheckField( const OUString sFieldName )
 {// modifies xClass!!!
+
+if ( xClass == NULL )
+return false;
+
 Reference reflection::XIdlField xField = xClass-getField( sFieldName );
 if( xField != NULL )
 {
@@ -3016,6 +3022,11 @@ bool UnoTypeCodeCompletetor::CheckField( const OUString 
sFieldName )
 
 bool UnoTypeCodeCompletetor::CheckMethod( const OUString sMethName )
 {// modifies xClass!!!
+
+
+if ( xClass == NULL )
+return false;
+
 Reference reflection::XIdlMethod xMethod = xClass-getMethod( sMethName 
);
 if( xMethod != NULL ) //method OK, check return type
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: basic/source sc/qa

2015-08-18 Thread Laurent Godard
 basic/source/classes/image.cxx  |  161 
 sc/qa/extras/macros-test.cxx|   33 
 sc/qa/extras/testdocuments/testTypePassword.ods |binary
 3 files changed, 194 insertions(+)

New commits:
commit 0405975042e91e5cca56068ad0d16ad8ab910737
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Mon Aug 17 13:28:16 2015 +0200

tdf#75973 : User Defined Types in password encrypted macros

save/load basic script so that when executing password protected
the user defined types can be rebuilt

supports array and nested types

a unit test in sc macros-test.cxx

Change-Id: Ie127ea7ad9aea3353741048c00f1b3910c5517a4
Reviewed-on: https://gerrit.libreoffice.org/17815
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index 0fa3d13..fa4feac 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -240,6 +240,90 @@ bool SbiImage::Load( SvStream r, sal_uInt32 nVersion )
 }
 break;
 }
+case B_SBXOBJECTS:
+
+// User defined types
+for (sal_uInt16 i = 0; i  nCount; i++)
+{
+OUString aTypeName = r.ReadUniOrByteString(eCharSet);
+
+sal_Int16 nTypeMembers;
+r.ReadInt16(nTypeMembers);
+
+SbxObject *pType = new SbxObject(aTypeName);
+SbxArray *pTypeMembers = pType-GetProperties();
+
+for (sal_uInt16 j = 0; j  nTypeMembers; j++)
+{
+OUString aMemberName = r.ReadUniOrByteString(eCharSet);
+
+sal_Int16 aIntMemberType;
+r.ReadInt16(aIntMemberType);
+SbxDataType aMemberType = static_cast SbxDataType  ( 
aIntMemberType );
+
+SbxProperty *pTypeElem = new SbxProperty( aMemberName, 
aMemberType );
+
+sal_uInt32 aIntFlag;
+r.ReadUInt32(aIntFlag);
+SbxFlagBits nElemFlags = static_cast SbxFlagBits  ( 
aIntFlag );
+
+pTypeElem-SetFlags(nElemFlags);
+
+sal_Int16 hasObject;
+r.ReadInt16(hasObject);
+
+if (hasObject == 1)
+{
+if(aMemberType == SbxOBJECT)
+{
+// nested user defined types
+// declared before use, so it is ok to 
reference it by name on load
+// nested types not structuraly compatible 
with arrays at the moment
+OUString aNestedTypeName = 
r.ReadUniOrByteString(eCharSet);
+SbxObject* pNestedTypeObj = static_cast 
SbxObject* ( rTypes-Find( aNestedTypeName, SbxCLASS_OBJECT ) );
+if (pNestedTypeObj)
+{
+SbxObject* pCloneObj = 
cloneTypeObjectImpl( *pNestedTypeObj );
+pTypeElem-PutObject( pCloneObj );
+}
+}
+else
+{
+// an array
+// not compatible with nested user defined 
types at the moment
+SbxDimArray* pArray = new SbxDimArray();
+
+sal_Int16 isFixedSize;
+r.ReadInt16(isFixedSize);
+if (isFixedSize == 1)
+pArray-setHasFixedSize( true );
+
+sal_Int32 nDims;
+r.ReadInt32(nDims);
+for (sal_Int32 d = 0; d  nDims; d++)
+{
+sal_Int32 lBound;
+sal_Int32 uBound;
+r.ReadInt32(lBound).ReadInt32(uBound);
+pArray-unoAddDim32(lBound, uBound);
+}
+
+pTypeElem-PutObject( pArray );
+}
+}
+
+pTypeMembers-Insert( pTypeElem, pTypeMembers-Count() 
);
+
+}
+
+pType-Remove( OUString(Name), SbxCLASS_DONTCARE );
+pType-Remove( OUString(Parent), SbxCLASS_DONTCARE );
+
+AddType(pType);
+}
+
+break;
+
 case B_MODEND:
 goto done

[Libreoffice-commits] core.git: basic/source

2015-08-18 Thread Laurent Godard
 basic/source/classes/image.cxx |4 
 1 file changed, 4 deletions(-)

New commits:
commit ba5fd0cc77d7d53004f46e4ca867a22d56c5baa7
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Tue Aug 18 11:59:06 2015 +0200

correct wrong comments

Change-Id: I6682248873bcd6302b1d8d041bbc2e19a8e0ba7b
Reviewed-on: https://gerrit.libreoffice.org/17831
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index fa4feac..bc6fa3a 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -278,7 +278,6 @@ bool SbiImage::Load( SvStream r, sal_uInt32 nVersion )
 {
 // nested user defined types
 // declared before use, so it is ok to 
reference it by name on load
-// nested types not structuraly compatible 
with arrays at the moment
 OUString aNestedTypeName = 
r.ReadUniOrByteString(eCharSet);
 SbxObject* pNestedTypeObj = static_cast 
SbxObject* ( rTypes-Find( aNestedTypeName, SbxCLASS_OBJECT ) );
 if (pNestedTypeObj)
@@ -290,7 +289,6 @@ bool SbiImage::Load( SvStream r, sal_uInt32 nVersion )
 else
 {
 // an array
-// not compatible with nested user defined 
types at the moment
 SbxDimArray* pArray = new SbxDimArray();
 
 sal_Int16 isFixedSize;
@@ -486,14 +484,12 @@ bool SbiImage::Save( SvStream r, sal_uInt32 nVer )
 {
 // nested user defined types
 // declared before use, so it is ok to reference it by 
name on load
-// not compatible with arrays at the moment
 SbxObject* pNestedType = static_cast SbxObject*  ( 
pElemObject );
 r.WriteUniOrByteString( pNestedType-GetClassName(), 
eCharSet );
 }
 else
 {
 // an array
-// not compatible with nested user defined types at 
the moment
 SbxDimArray* pArray = static_cast SbxDimArray*  ( 
pElemObject );
 
 bool bFixedSize = pArray-hasFixedSize();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: basic/source

2015-08-18 Thread Laurent Godard
 basic/source/classes/image.cxx |  103 +
 1 file changed, 53 insertions(+), 50 deletions(-)

New commits:
commit 6e403346634113f7b5d582774864baa4555b2843
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Tue Aug 18 13:40:42 2015 +0200

null pointer guard if no user defined types declared at the module level

Change-Id: I368a168c636e4029e9cd9bbe4a4df5d9b846c923
Reviewed-on: https://gerrit.libreoffice.org/17834
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index bc6fa3a..ef468dc 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -443,79 +443,82 @@ bool SbiImage::Save( SvStream r, sal_uInt32 nVer )
 SbiCloseRecord( r, nPos );
 }
 // User defined types
-sal_uInt16 nTypes = rTypes-Count();
-if (nTypes  0 )
+if (rTypes)
 {
-nPos = SbiOpenRecord( r, B_SBXOBJECTS, nTypes );
-
-for (sal_uInt16 i = 0; i  nTypes; i++)
+sal_uInt16 nTypes = rTypes-Count();
+if (nTypes  0 )
 {
-SbxObject* pType = static_cast SbxObject*  ( rTypes-Get(i) );
-OUString aTypeName = pType-GetClassName();
+nPos = SbiOpenRecord( r, B_SBXOBJECTS, nTypes );
 
-r.WriteUniOrByteString( aTypeName, eCharSet );
+for (sal_uInt16 i = 0; i  nTypes; i++)
+{
+SbxObject* pType = static_cast SbxObject*  ( rTypes-Get(i) 
);
+OUString aTypeName = pType-GetClassName();
 
-SbxArray  *pTypeMembers = pType-GetProperties();
-sal_uInt16 nTypeMembers = pTypeMembers-Count();
+r.WriteUniOrByteString( aTypeName, eCharSet );
 
-r.WriteInt16(nTypeMembers);
+SbxArray  *pTypeMembers = pType-GetProperties();
+sal_uInt16 nTypeMembers = pTypeMembers-Count();
 
-for (sal_uInt16 j = 0; j  nTypeMembers; j++)
-{
+r.WriteInt16(nTypeMembers);
 
-SbxProperty* pTypeElem = static_cast SbxProperty*  ( 
pTypeMembers-Get(j) );
+for (sal_uInt16 j = 0; j  nTypeMembers; j++)
+{
 
-OUString aElemName = pTypeElem-GetName();
-r.WriteUniOrByteString( aElemName, eCharSet );
+SbxProperty* pTypeElem = static_cast SbxProperty*  ( 
pTypeMembers-Get(j) );
 
-SbxDataType dataType =   pTypeElem-GetType();
-r.WriteInt16(dataType);
+OUString aElemName = pTypeElem-GetName();
+r.WriteUniOrByteString( aElemName, eCharSet );
 
-SbxFlagBits nElemFlags = pTypeElem-GetFlags();
-r.WriteUInt32(static_cast sal_uInt32  (nElemFlags) );
+SbxDataType dataType =   pTypeElem-GetType();
+r.WriteInt16(dataType);
 
-SbxBase* pElemObject = pTypeElem-GetObject();
+SbxFlagBits nElemFlags = pTypeElem-GetFlags();
+r.WriteUInt32(static_cast sal_uInt32  (nElemFlags) );
 
-if (pElemObject)
-{
-r.WriteInt16(1); // has elem Object
+SbxBase* pElemObject = pTypeElem-GetObject();
 
-if( dataType == SbxOBJECT )
+if (pElemObject)
 {
-// nested user defined types
-// declared before use, so it is ok to reference it by 
name on load
-SbxObject* pNestedType = static_cast SbxObject*  ( 
pElemObject );
-r.WriteUniOrByteString( pNestedType-GetClassName(), 
eCharSet );
-}
-else
-{
-// an array
-SbxDimArray* pArray = static_cast SbxDimArray*  ( 
pElemObject );
+r.WriteInt16(1); // has elem Object
 
-bool bFixedSize = pArray-hasFixedSize();
-if (bFixedSize)
-r.WriteInt16(1);
+if( dataType == SbxOBJECT )
+{
+// nested user defined types
+// declared before use, so it is ok to reference 
it by name on load
+SbxObject* pNestedType = static_cast SbxObject*  
( pElemObject );
+r.WriteUniOrByteString( 
pNestedType-GetClassName(), eCharSet );
+}
 else
-r.WriteInt16(0);
+{
+// an array
+SbxDimArray* pArray = static_cast SbxDimArray*  
( pElemObject );
 
-sal_Int32 nDims

Re: Question on 5.0 and StarDesktop.loadComponentFromURL

2015-08-15 Thread Laurent Godard

Hi


Is the oDoc = StarDesktop.loadComponentFromURL still valid in 5.0 ?



sure !


I am calling it in my macro and getting an error about the  URL parameter
which is file:///tmp/file.ptt
so seems as though the file URL is OK and the file is present.




wild guess
file.ppt not ptt which is an unknown format ?


The error is BASIC runtime... type detection failed.



-- type detection

HTH

Laurent
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source

2015-08-07 Thread Laurent Godard
 sc/source/ui/view/viewdata.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 35e449707501c2f19a585fba3efcf1ccd217df6e
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Thu Jul 9 17:00:54 2015 +0200

init maTabData to the correct tab size tdf#92629

Change-Id: I6b226f8e992b3a2b6bcebc44b36ca1f2f06a128e
Reviewed-on: https://gerrit.libreoffice.org/16894
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com
(cherry picked from commit ebdc15f93587b59a79a5104f8358841a28940a82)

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 8795afe..04d11f3 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -370,6 +370,12 @@ ScViewData::ScViewData( ScDocShell* pDocSh, 
ScTabViewShell* pViewSh ) :
 pThisTab = maTabData[nTabNo];
 }
 
+if (pDoc)
+{
+SCTAB nTableCount = pDoc-GetTableCount();
+EnsureTabDataSize(nTableCount);
+}
+
 CalcPPT();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sc/source

2015-07-09 Thread Laurent Godard
 sc/source/ui/view/viewdata.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit ebdc15f93587b59a79a5104f8358841a28940a82
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Thu Jul 9 17:00:54 2015 +0200

init maTabData to the correct tab size tdf#92629

Change-Id: I6b226f8e992b3a2b6bcebc44b36ca1f2f06a128e
Reviewed-on: https://gerrit.libreoffice.org/16894
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index b294c74..5569d0c 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -370,6 +370,12 @@ ScViewData::ScViewData( ScDocShell* pDocSh, 
ScTabViewShell* pViewSh ) :
 pThisTab = maTabData[nTabNo];
 }
 
+if (pDoc)
+{
+SCTAB nTableCount = pDoc-GetTableCount();
+EnsureTabDataSize(nTableCount);
+}
+
 CalcPPT();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/sfx2 sfx2/Module_sfx2.mk sfx2/PythonTest_sfx2_python.mk sfx2/qa sfx2/source unotest/source

2015-06-23 Thread Laurent Godard
 include/sfx2/sidebar/ResourceManager.hxx |2 
 include/sfx2/sidebar/SidebarController.hxx   |2 
 sfx2/Module_sfx2.mk  |6 
 sfx2/PythonTest_sfx2_python.mk   |   20 +++
 sfx2/qa/python/check_sidebar.py  |  149 +++
 sfx2/source/sidebar/ResourceManager.cxx  |   16 ++
 sfx2/source/sidebar/SidebarController.cxx|   12 +
 sfx2/source/sidebar/UnoDeck.cxx  |9 +
 unotest/source/python/org/libreoffice/unotest.py |   14 ++
 9 files changed, 230 insertions(+)

New commits:
commit 187445b2d2885ced92be37ffb11cd2a9bb11f8d6
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Mon Jun 8 10:24:42 2015 +0200

Uno api sidebar unit test tdf#91806

- python test subsequentcheck
- correct deck setTitle APi (UI update)
- enhance UnoInProcess for flexiility in loading parameter

Change-Id: Id04cb78c6162ac84fb3bfd8577f84763109d993e
Reviewed-on: https://gerrit.libreoffice.org/16180
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Tomaž Vajngerl qui...@gmail.com

diff --git a/include/sfx2/sidebar/ResourceManager.hxx 
b/include/sfx2/sidebar/ResourceManager.hxx
index 4e6247d..5768db0 100644
--- a/include/sfx2/sidebar/ResourceManager.hxx
+++ b/include/sfx2/sidebar/ResourceManager.hxx
@@ -58,6 +58,8 @@ public:
 */
 void SetIsDeckEnabled(const OUString rsDeckId, const bool bIsEnabled);
 
+void SetDeckTitle(const OUString rsDeckId, const OUString sTitle);
+
 void SetDeckToDescriptor(const OUString rsDeckId, VclPtrDeck aDeck);
 
 void SetDeckOrderIndex(const OUString rsDeckId, const sal_Int32 
orderIndex);
diff --git a/include/sfx2/sidebar/SidebarController.hxx 
b/include/sfx2/sidebar/SidebarController.hxx
index 58bca04..29c7d43 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -154,6 +154,8 @@ public:
 ResourceManager::DeckContextDescriptorContainer GetMatchingDecks();
 ResourceManager::PanelContextDescriptorContainer GetMatchingPanels( const 
::rtl::OUString rDeckId);
 
+void notifyDeckTitle(const OUString targetDeckId);
+
 private:
 typedef ::std::map
 const css::uno::Referencecss::frame::XFrame,
diff --git a/sfx2/Module_sfx2.mk b/sfx2/Module_sfx2.mk
index 3ebdfa1..792668e 100644
--- a/sfx2/Module_sfx2.mk
+++ b/sfx2/Module_sfx2.mk
@@ -40,6 +40,12 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sfx2,\
 ))
 endif
 
+ifneq ($(DISABLE_PYTHON),TRUE)
+$(eval $(call gb_Module_add_subsequentcheck_targets,sfx2,\
+   PythonTest_sfx2_python \
+))
+endif
+
 ifneq (,$(filter LINUX DRAGONFLY OPENBSD FREEBSD NETBSD SOLARIS, $(OS)))
 ifeq ($(ENABLE_SYSTRAY_GTK),TRUE)
 $(eval $(call gb_Module_add_targets,sfx2,\
diff --git a/sfx2/PythonTest_sfx2_python.mk b/sfx2/PythonTest_sfx2_python.mk
new file mode 100644
index 000..4300110
--- /dev/null
+++ b/sfx2/PythonTest_sfx2_python.mk
@@ -0,0 +1,20 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_PythonTest_PythonTest,sfx2_python))
+
+$(eval $(call gb_PythonTest_set_defs,sfx2_python,\
+TDOC=$(SRCDIR)/sfx2/qa/python/testdocuments \
+))
+
+$(eval $(call gb_PythonTest_add_modules,sfx2_python,$(SRCDIR)/sfx2/qa/python,\
+   check_sidebar \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sfx2/qa/python/check_sidebar.py b/sfx2/qa/python/check_sidebar.py
new file mode 100644
index 000..355951a
--- /dev/null
+++ b/sfx2/qa/python/check_sidebar.py
@@ -0,0 +1,149 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+import unittest
+import unohelper
+import os
+from org.libreoffice.unotest import UnoInProcess
+
+from com.sun.star.ui import XSidebarProvider
+from com.sun.star.ui import XDecks
+from com.sun.star.ui import XDeck
+from com.sun.star.ui import XPanels
+from com.sun.star.ui import XPanel
+
+class CheckSidebar(unittest.TestCase):
+_uno = None
+_xDoc = None
+
+@classmethod
+def setUpClass(cls):
+cls._uno = UnoInProcess()
+cls._uno.setUp()
+cls._xDoc = cls._uno.openEmptyDoc( url = private:factory/scalc, 
bHidden = False, bReadOnly = False)
+
+@classmethod
+def tearDownClass(cls):
+cls._uno.tearDown() 
+
+def test_check_sidebar(self):
+
+xDoc = self.__class__._xDoc
+xController = xDoc.getCurrentController()
+
+xSidebar = xController.getSidebar

[Libreoffice-commits] core.git: dbaccess/source include/dbaccess include/sfx2 offapi/com offapi/UnoApi_offapi.mk sfx2/Library_sfx.mk sfx2/source vcl/source

2015-06-21 Thread Laurent Godard
|  155 +---
 sfx2/source/sidebar/SidebarController.hxx|  257 -
 sfx2/source/sidebar/SidebarDockingWindow.cxx |4 
 sfx2/source/sidebar/SidebarDockingWindow.hxx |   61 -
 sfx2/source/sidebar/SidebarResource.hxx  |   35 --
 sfx2/source/sidebar/TabBar.cxx   |   31 +-
 sfx2/source/sidebar/TabBar.hxx   |  130 --
 sfx2/source/sidebar/TabItem.cxx  |6 
 sfx2/source/sidebar/TabItem.hxx  |   55 
 sfx2/source/sidebar/Theme.cxx|4 
 sfx2/source/sidebar/TitleBar.cxx |8 
 sfx2/source/sidebar/TitleBar.hxx |   79 --
 sfx2/source/sidebar/ToolBox.hxx  |   53 
 sfx2/source/sidebar/UnoDeck.cxx  |  262 +
 sfx2/source/sidebar/UnoDecks.cxx |  168 ++
 sfx2/source/sidebar/UnoPanel.cxx |  271 ++
 sfx2/source/sidebar/UnoPanels.cxx|  180 +++
 sfx2/source/sidebar/UnoSidebar.cxx   |  102 
 sfx2/source/view/sfxbasecontroller.cxx   |   15 +
 vcl/source/window/window.cxx |1 
 100 files changed, 4007 insertions(+), 2077 deletions(-)

New commits:
commit a64999511ae654131d997eec9a3d78478cfc1c75
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Thu Apr 30 16:56:14 2015 +0200

new uno sidebar api tdf#91806

the entry point is SfxBaseController::getSidebar()

the Decks and panels are now per SidebarController and not global anymore

' macro example
Sub testSidebarApi

controller =  thisComponent.currentcontroller
frameIni =  thisComponent.currentcontroller.frame
sidebar =  thisComponent.currentcontroller.getSidebar()

sidebar.setVisible(true)

frame = sidebar.getFrame()

decks = sidebar.getdecks()

c = decks.count

h = decks.hasElements()

e = decks.getElementNames()

a =  decks.hasByName(MyDeck)

deck = decks.getByName(MyDeck)
deck.activate(true)

t = deck.getTitle()
deck.setTitle(new deck title)

deck.moveFirst()
deck.moveLast()
deck.moveUp()
deck.moveDown()

index = deck.getOrderIndex()

panels = deck.getPanels()
ep = panels.getElementnames()

ap = panels.hasByName(aPanelName)

panel = panels.getByName(aPanelName)
panel.setTitle(new panel title)

panel.collapse()

panel.expand(true) ' expand and collapse other

index = panel.getOrderIndex()

panel.moveLast()
panel.moveFirst()
panel.moveDown()
panel.moveUp()

End Sub

Change-Id: I7a4b953f2277dea483bb296ba6ead35de7205ace
Reviewed-on: https://gerrit.libreoffice.org/15856
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Tomaž Vajngerl qui...@gmail.com
Tested-by: Tomaž Vajngerl qui...@gmail.com

diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx 
b/dbaccess/source/ui/browser/genericcontroller.cxx
index 405bb91..42bd37f 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -45,6 +45,10 @@
 #include UITools.hxx
 #include commontypes.hxx
 
+#include com/sun/star/ui/XSidebarProvider.hpp
+#include sfx2/sidebar/UnoSidebar.hxx
+
+
 #include vcl/waitobj.hxx
 #include svl/urihelper.hxx
 #include datasourceconnector.hxx
@@ -72,6 +76,7 @@ using namespace ::com::sun::star::sdbc;
 using namespace ::com::sun::star::sdb;
 using namespace ::com::sun::star::task;
 using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::ui;
 using namespace ::dbtools;
 using namespace ::comphelper;
 
@@ -367,6 +372,11 @@ Reference XWindow  SAL_CALL 
OGenericUnoController::getComponentWindow() throw
 return VCLUnoHelper::GetInterface( getView() );
 }
 
+ReferenceXSidebarProvider SAL_CALL OGenericUnoController::getSidebar() throw 
(RuntimeException, std::exception)
+{
+return NULL;
+}
+
 OUString SAL_CALL OGenericUnoController::getViewControllerName() throw 
(::com::sun::star::uno::RuntimeException, std::exception)
 {
 return OUString( Default );
diff --git a/include/dbaccess/genericcontroller.hxx 
b/include/dbaccess/genericcontroller.hxx
index 07a9dec..f195321 100644
--- a/include/dbaccess/genericcontroller.hxx
+++ b/include/dbaccess/genericcontroller.hxx
@@ -61,6 +61,8 @@
 #include sfx2/userinputinterception.hxx
 #include vcl/vclptr.hxx
 
+#include com/sun/star/ui/XSidebarProvider.hpp
+
 namespace dbtools
 {
 class SQLExceptionInfo;
@@ -465,6 +467,9 @@ namespace dbaui
 virtual OUString SAL_CALL getViewControllerName() throw 
(::com::sun::star::uno::RuntimeException, std

[Libreoffice-commits] core.git: sw/CppunitTest_sw_docbookexport.mk sw/Module_sw.mk sw/qa

2015-05-21 Thread Laurent Godard
 sw/CppunitTest_sw_docbookexport.mk|   58 ++
 sw/Module_sw.mk   |1 
 sw/qa/extras/docbookexport/data/simple.docx   |binary
 sw/qa/extras/docbookexport/data/tdf91095.docx |binary
 sw/qa/extras/docbookexport/docbookexport.cxx  |   50 ++
 5 files changed, 109 insertions(+)

New commits:
commit fb8377fe404564871d7be8cf777abe2108c74951
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Wed May 6 16:36:52 2015 +0200

unit test for tdf#91095

and ready for any docbook export tests

Change-Id: Ia1c7a5066fc72c502c3b0ebb5811910797943742
Reviewed-on: https://gerrit.libreoffice.org/15653
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/CppunitTest_sw_docbookexport.mk 
b/sw/CppunitTest_sw_docbookexport.mk
new file mode 100644
index 000..9bed3e13
--- /dev/null
+++ b/sw/CppunitTest_sw_docbookexport.mk
@@ -0,0 +1,58 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+#*
+
+$(eval $(call gb_CppunitTest_CppunitTest,sw_docbookexport))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_docbookexport, \
+sw/qa/extras/docbookexport/docbookexport \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sw_docbookexport, \
+comphelper \
+cppu \
+   cppuhelper \
+   i18nlangtag \
+sal \
+sw \
+test \
+   tl \
+unotest \
+utl \
+vcl \
+   $(gb_UWINAPI) \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sw_docbookexport,\
+   boost_headers \
+libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sw_docbookexport,\
+-I$(SRCDIR)/sw/inc \
+-I$(SRCDIR)/sw/source/core/inc \
+-I$(SRCDIR)/sw/source/uibase/inc \
+   -I$(SRCDIR)/sw/qa/extras/inc \
+$$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,sw_docbookexport,\
+offapi \
+udkapi \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,sw_docbookexport))
+$(eval $(call gb_CppunitTest_use_vcl,sw_docbookexport))
+
+$(eval $(call gb_CppunitTest_use_rdb,sw_docbookexport,services))
+
+$(eval $(call gb_CppunitTest_use_configuration,sw_docbookexport))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index 13453b5..ce01e9a 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -48,6 +48,7 @@ endif
 $(eval $(call gb_Module_add_slowcheck_targets,sw,\
$(if $(and $(filter $(COM),MSC),$(MERGELIBS)),, \
CppunitTest_sw_uwriter) \
+CppunitTest_sw_docbookexport \
 CppunitTest_sw_htmlexport \
 CppunitTest_sw_htmlimport \
 CppunitTest_sw_macros_test \
diff --git a/sw/qa/extras/docbookexport/data/simple.docx 
b/sw/qa/extras/docbookexport/data/simple.docx
new file mode 100644
index 000..89081fd
Binary files /dev/null and b/sw/qa/extras/docbookexport/data/simple.docx differ
diff --git a/sw/qa/extras/docbookexport/data/tdf91095.docx 
b/sw/qa/extras/docbookexport/data/tdf91095.docx
new file mode 100644
index 000..fbe23c8
Binary files /dev/null and b/sw/qa/extras/docbookexport/data/tdf91095.docx 
differ
diff --git a/sw/qa/extras/docbookexport/docbookexport.cxx 
b/sw/qa/extras/docbookexport/docbookexport.cxx
new file mode 100644
index 000..2f52546
--- /dev/null
+++ b/sw/qa/extras/docbookexport/docbookexport.cxx
@@ -0,0 +1,50 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include swmodeltestbase.hxx
+
+#include swmodule.hxx
+#include swdll.hxx
+#include usrpref.hxx
+
+#include test/xmltesttools.hxx
+
+class DocbookExportTest : public SwModelTestBase
+{
+private:
+FieldUnit m_eUnit;
+
+public:
+DocbookExportTest() :
+SwModelTestBase(/sw/qa/extras/docbookexport/data/, DocBook File),
+m_eUnit(FUNIT_NONE)
+{}
+};
+
+#define DECLARE_DOCBOOKEXPORT_TEST(TestName, filename) 
DECLARE_SW_EXPORT_TEST(TestName, filename, DocbookExportTest)
+
+DECLARE_DOCBOOKEXPORT_TEST(testsimple, simple.docx)
+{
+xmlDocPtr pDoc = parseXml(maTempFile);
+CPPUNIT_ASSERT(pDoc);
+
+assertXPathContent(pDoc, /article/para, );
+}
+
+/* the test actually should crash with this file */
+DECLARE_DOCBOOKEXPORT_TEST(testtdf91095, tdf91095.docx)
+{
+xmlDocPtr pDoc = parseXml(maTempFile);
+CPPUNIT_ASSERT(pDoc

[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sc/source

2015-05-20 Thread Laurent Godard
 sc/source/ui/view/gridwin4.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit ab6ea2f8e73c4a0785bb2a6b256fc521ee120d98
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Tue May 19 18:10:18 2015 +0200

draw Note mark before text for correct ZOrder tdf#89182

the cell content is now drawn over the cell note rectangle

Change-Id: I6874ecd879b01ebc27b5eb912d472af704387a1f
Reviewed-on: https://gerrit.libreoffice.org/15823
Reviewed-by: Adolfo Jayme Barrientos fit...@ubuntu.com
Tested-by: Adolfo Jayme Barrientos fit...@ubuntu.com

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 545e071..1ab1b3b 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -693,6 +693,11 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, 
SCROW nY2, ScUpdateMod
 
 aOutputData.DrawShadow();
 aOutputData.DrawFrame();
+
+// Show Note Mark
+if ( rOpts.GetOption( VOPT_NOTES ) )
+aOutputData.DrawNoteMarks();
+
 if ( !bLogicText )
 aOutputData.DrawStrings(false); // in pixel MapMode
 
@@ -709,11 +714,6 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, 
SCROW nY2, ScUpdateMod
 
 DrawButtons( nX1, nX2, aTabInfo, pContentDev );  // Pixel
 
-// Notiz-Anzeiger
-
-if ( rOpts.GetOption( VOPT_NOTES ) )
-aOutputData.DrawNoteMarks();
-
 aOutputData.DrawClipMarks();
 
 //  Szenario / ChangeTracking muss auf jeden Fall nach DrawGrid sein, auch 
bei !bGridFirst
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sc/source

2015-05-19 Thread Laurent Godard
 sc/source/ui/view/gridwin4.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 2d1abfff0156c17cdaabf27c01e92b5e3f0bbbf4
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Tue May 19 14:36:44 2015 +0200

draw Note mark before text for correct ZOrder tdf#89182

the cell content is now drawn over the cell note rectangle

Change-Id: Idce05497b7a9f67e5e315f5bc2f9c59e53898131
Reviewed-on: https://gerrit.libreoffice.org/15802
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index a3e5170..c175d02 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -741,6 +741,11 @@ void ScGridWindow::DrawContent(OutputDevice rDevice, 
const ScTableInfo rTableI
 
 aOutputData.DrawShadow();
 aOutputData.DrawFrame();
+
+// Show Note Mark
+if ( rOpts.GetOption( VOPT_NOTES ) )
+aOutputData.DrawNoteMarks();
+
 if ( !bLogicText )
 aOutputData.DrawStrings(false); // in pixel MapMode
 
@@ -757,11 +762,6 @@ void ScGridWindow::DrawContent(OutputDevice rDevice, 
const ScTableInfo rTableI
 
 DrawButtons(nX1, nX2, rTableInfo, pContentDev);  // Pixel
 
-// Notiz-Anzeiger
-
-if ( rOpts.GetOption( VOPT_NOTES ) )
-aOutputData.DrawNoteMarks();
-
 aOutputData.DrawClipMarks();
 
 //  Szenario / ChangeTracking muss auf jeden Fall nach DrawGrid sein, auch 
bei !bGridFirst
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: Uno sidebar API proposal

2015-04-29 Thread Laurent Godard

Hi Fernand

,

More properties: Size , colors, background ?
What about having the DialogControls available (ProgressBar, Watch,
Images, listbox.)



this is what is intended in
Panel.getDialog (giving a XUnoControlDialog i think)
you'd get the Dialog and then be able to gain each control (via the 
controlContainer)


btw, i think that properties, metods aso can be added once the core api 
is built


my question is more about about the correctness of the overall rough design

thanks for your response

Laurent
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Uno sidebar API proposal

2015-04-29 Thread Laurent Godard

Hi all

The libreoffice sidebar can be enhanced by adding Decks and Panels via 
extensions
Unfortunatelly, there is no available UNO API to easily manipulate the 
sidebar, the decks, the panels once deployed


So I plan to write some (first ideas at the end of the mail)
(targeting calc  writer for the moment)

i did some premiminary PoC using the existing sfx2/sidebar stuff
There seems to be some limitations and i'll probably have to rework this

for example, only the current active deck object is available. deck 
seems to be rebuilt at each changes

why such a choice ?
would it be too costly to build/store all the desks/panels

I would like your opinion about the approach and be assured that this 
work will be not dropped (if i succeed as my skills are limited)


I'll work on a separate branch and will follow carefully the GSoC 
related to this sidebar topic


Any comment welcomme

Laurent

'--
firs ideas on an UNO Sidebar API


* currenController or XComponent ?
-- getSidebar -- see *currentSidebar

* currentSidebar
-- enable/disable : show or hides the sidebar (as menu view  sidebar)
-- getDesks -- see *Desks
-- getEnabledDesksNames
-- getActiveDesk -- see *Desk

* Desks
-- count
-- getByName -- see *Desk
-- getByindex -- see *Desk

* Desk
-- show/hide (or activate ?)
-- enable/disable (same as the checkboxes of the sidebar 
customization dropdown menu)
-- setIndex : to control the dispaly order of desks icons ? moves 
down the other ? only for custom desks (deployed by extension) to 
preserve built-in desks layout ?

-- getPanels -- see *Panels
-- some properties (name, label, context ...)

* Panels
-- count
-- getByName -- see *Panel
-- getByindex -- see *Panel

* Panel
-- expand/collapse (with option for collapsing all the other if 
expand)
-- setIndex : to control the display order of panels in the deck ? 
moves down the other ?

-- getDialog : get the dialog object to be able to access UI controls
-- some properties (name, label, )
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: offapi/com

2015-04-14 Thread Laurent Godard
 offapi/com/sun/star/util/XNumberFormats.idl |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f02ef85f4a5b6770cddf94ccc2eeb3c187d67b22
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Mon Apr 13 18:42:25 2015 +0200

remove build warning

Change-Id: I533d603ac1f073336eda99de57892ff5e12132d4
Reviewed-on: https://gerrit.libreoffice.org/15288
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Michael Stahl mst...@redhat.com

diff --git a/offapi/com/sun/star/util/XNumberFormats.idl 
b/offapi/com/sun/star/util/XNumberFormats.idl
index 7d9c0f5..8e4bcbe 100644
--- a/offapi/com/sun/star/util/XNumberFormats.idl
+++ b/offapi/com/sun/star/util/XNumberFormats.idl
@@ -154,7 +154,7 @@ published interface XNumberFormats: 
com::sun::star::uno::XInterface
 the thousands separator is shown or not
 
 @param bRed
-show negative number in red colored if TRUE/
+show negative number in red colored if `TRUE`
 
 @param nDecimals
 how many digits are shown after the decimal point
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Add Sidebar Uno api - starting questions

2015-04-10 Thread Laurent Godard

Hi all

I would like to make the sidebar layout available through UNO api 
(targeting writer  calc for the moment)


the first steps i would like to achieve are

- get the sidebar object
  -- setVisible (true/false)
  -- get Deck ListNames
  -- set Active Deck by name
  -- get a Deck (byName or by Index)
 -- get its Panel ListNames
 -- get a panel by name or index
 -- colapse/expand the panel

I think i have all available in
http://opengrok.libreoffice.org/xref/core/sfx2/source/sidebar/

and some interresting methods in
http://opengrok.libreoffice.org/xref/core/sfx2/source/sidebar/ResourceManager.cxx

Do you think it is doable ?

My request is having some code pointers to help starting especially on 
getting the initial sidebar object from current component (frame)

Where should i look ?

I guess i'll have to write some dedicated uno glue code. where should i 
put it ? in sfx2/source/sidebar/ ?

Is there any existing code i could take as examples ?  (in impress) ?

I'm also looking to a (sort of) mentor i could ping occasionally on IRC

Well, you see, a lot of requets :)

But only for a starting point. then i'll try to achive my goal and 
propose some patch to be reviewed in a reasonable timeline


feel free to ask if something is not clear

thanks in advance

Laurent
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sc/source

2015-03-30 Thread Laurent Godard
 sc/source/core/data/document.cxx |   56 +--
 1 file changed, 37 insertions(+), 19 deletions(-)

New commits:
commit 7042961f4d3e383c04f792a60e96d909b7e44363
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Fri Mar 20 12:02:31 2015 +0100

tdf#90042 only handle formula group if useful

Reviewed-on: https://gerrit.libreoffice.org/14920
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com
(cherry picked from commit c79bdd062f657d1be98aa815d9b882d144f35e04)

only handle formula group if useful, tdf#90042 related

Same as in ScDocument::SetString() as changed with
c79bdd062f657d1be98aa815d9b882d144f35e04, do it similar in
ScDocument::SetValue()

(cherry picked from commit 02bea75dd6bc91759e987fafb5dccec6ce92b0c2)

7c666b176062c81a8a74cb49f345408c1060d973

Change-Id: I497a5bae4b08b46357415501ddbafc70585adfb0
Reviewed-on: https://gerrit.libreoffice.org/15036
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index b9307c1..ff5ffe7 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3204,19 +3204,29 @@ bool ScDocument::SetString( SCCOL nCol, SCROW nRow, 
SCTAB nTab, const OUString
 if (!pTab)
 return false;
 
-// In case setting this string affects an existing formula group, record
-// its above and below position for later listening.
+bool bNumFmtSet = false;
 
-std::vectorScAddress aGroupPos;
-sc::EndListeningContext aCxt(*this);
-ScAddress aPos(nCol, nRow, nTab);
-EndListeningIntersectedGroup(aCxt, aPos, aGroupPos);
-aCxt.purgeEmptyBroadcasters();
+const ScFormulaCell* pCurCellFormula = pTab-GetFormulaCell(nCol, nRow);
+if (pCurCellFormula  pCurCellFormula-IsShared())
+{
+// In case setting this string affects an existing formula group, 
record
+// its above and below position for later listening.
 
-bool bNumFmtSet = pTab-SetString(nCol, nRow, nTab, rString, pParam);
+std::vectorScAddress aGroupPos;
+sc::EndListeningContext aCxt(*this);
+ScAddress aPos(nCol, nRow, nTab);
+EndListeningIntersectedGroup(aCxt, aPos, aGroupPos);
+aCxt.purgeEmptyBroadcasters();
 
-SetNeedsListeningGroups(aGroupPos);
-StartNeededListeners();
+bNumFmtSet = pTab-SetString(nCol, nRow, nTab, rString, pParam);
+
+SetNeedsListeningGroups(aGroupPos);
+StartNeededListeners();
+}
+else
+{
+bNumFmtSet = pTab-SetString(nCol, nRow, nTab, rString, pParam);
+}
 
 return bNumFmtSet;
 }
@@ -3303,18 +3313,26 @@ void ScDocument::SetValue( const ScAddress rPos, 
double fVal )
 if (!pTab)
 return;
 
-// In case setting this string affects an existing formula group, record
-// its above and below position for later listening.
+const ScFormulaCell* pCurCellFormula = pTab-GetFormulaCell(rPos.Col(), 
rPos.Row());
+if (pCurCellFormula  pCurCellFormula-IsShared())
+{
+// In case setting this string affects an existing formula group, 
record
+// its above and below position for later listening.
 
-std::vectorScAddress aGroupPos;
-sc::EndListeningContext aCxt(*this);
-EndListeningIntersectedGroup(aCxt, rPos, aGroupPos);
-aCxt.purgeEmptyBroadcasters();
+std::vectorScAddress aGroupPos;
+sc::EndListeningContext aCxt(*this);
+EndListeningIntersectedGroup(aCxt, rPos, aGroupPos);
+aCxt.purgeEmptyBroadcasters();
 
-pTab-SetValue(rPos.Col(), rPos.Row(), fVal);
+pTab-SetValue(rPos.Col(), rPos.Row(), fVal);
 
-SetNeedsListeningGroups(aGroupPos);
-StartNeededListeners();
+SetNeedsListeningGroups(aGroupPos);
+StartNeededListeners();
+}
+else
+{
+pTab-SetValue(rPos.Col(), rPos.Row(), fVal);
+}
 }
 
 OUString ScDocument::GetString( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sc/source

2015-03-27 Thread Laurent Godard
 sc/source/core/data/document.cxx |   30 --
 1 file changed, 20 insertions(+), 10 deletions(-)

New commits:
commit c79bdd062f657d1be98aa815d9b882d144f35e04
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Fri Mar 20 12:02:31 2015 +0100

tdf#90042 only handle formula group if useful

Change-Id: I497a5bae4b08b46357415501ddbafc70585adfb0
Reviewed-on: https://gerrit.libreoffice.org/14920
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 506cb2d..98ea133 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3214,19 +3214,29 @@ bool ScDocument::SetString( SCCOL nCol, SCROW nRow, 
SCTAB nTab, const OUString
 if (!pTab)
 return false;
 
-// In case setting this string affects an existing formula group, record
-// its above and below position for later listening.
+bool bNumFmtSet = false;
 
-std::vectorScAddress aGroupPos;
-sc::EndListeningContext aCxt(*this);
-ScAddress aPos(nCol, nRow, nTab);
-EndListeningIntersectedGroup(aCxt, aPos, aGroupPos);
-aCxt.purgeEmptyBroadcasters();
+const ScFormulaCell* pCurCellFormula = pTab-GetFormulaCell(nCol, nRow);
+if (pCurCellFormula  pCurCellFormula-IsShared())
+{
+// In case setting this string affects an existing formula group, 
record
+// its above and below position for later listening.
 
-bool bNumFmtSet = pTab-SetString(nCol, nRow, nTab, rString, pParam);
+std::vectorScAddress aGroupPos;
+sc::EndListeningContext aCxt(*this);
+ScAddress aPos(nCol, nRow, nTab);
+EndListeningIntersectedGroup(aCxt, aPos, aGroupPos);
+aCxt.purgeEmptyBroadcasters();
 
-SetNeedsListeningGroups(aGroupPos);
-StartNeededListeners();
+bNumFmtSet = pTab-SetString(nCol, nRow, nTab, rString, pParam);
+
+SetNeedsListeningGroups(aGroupPos);
+StartNeededListeners();
+}
+else
+{
+bNumFmtSet = pTab-SetString(nCol, nRow, nTab, rString, pParam);
+}
 
 return bNumFmtSet;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/uiconfig

2015-03-02 Thread Laurent Godard
 desktop/uiconfig/ui/extensionmanager.ui |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit f16c427d5668e5fe9d41268e18a71cfca3aaf1c1
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Mon Mar 2 17:53:43 2015 +0100

correct control overlapping - minor UI refactoring

the gtk-cancel button overlapped the adding extension label if 
%EXTENSION_NAME is too long.

Change-Id: Ia6a650d7ff82853155da67527a1cdc865b01148e
Reviewed-on: https://gerrit.libreoffice.org/14717
Reviewed-by: Adolfo Jayme Barrientos fit...@ubuntu.com
Tested-by: Adolfo Jayme Barrientos fit...@ubuntu.com

diff --git a/desktop/uiconfig/ui/extensionmanager.ui 
b/desktop/uiconfig/ui/extensionmanager.ui
index 5e21515..7db4d20 100644
--- a/desktop/uiconfig/ui/extensionmanager.ui
+++ b/desktop/uiconfig/ui/extensionmanager.ui
@@ -199,12 +199,13 @@
   object class=GtkLabel id=progressft
 property name=can_focusFalse/property
 property name=no_show_allTrue/property
-property name=margin_left50/property
+property name=justifyright/property
 property name=label translatable=yesAdding 
%EXTENSION_NAME/property
   /object
   packing
-property name=left_attach1/property
+property name=left_attach0/property
 property name=top_attach0/property
+property name=width2/property
   /packing
 /child
 child
@@ -243,7 +244,7 @@
   /object
   packing
 property name=left_attach0/property
-property name=top_attach0/property
+property name=top_attach1/property
   /packing
 /child
   /object
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sc/source

2015-02-19 Thread Laurent Godard
 sc/source/ui/docshell/docsh4.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit bf57bbef91bc40090561d614e4c2070c01aef7cb
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Thu Feb 19 10:45:26 2015 +0100

tdf#89460 test pChangeTrack before using it

Reviewed-on: https://gerrit.libreoffice.org/14553
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com
(cherry picked from commit bf5c5f359cf4eb36a0a9a1110ec2aa3393bb87df)

Conflicts:
sc/source/ui/docshell/docsh4.cxx

Change-Id: Ic02351c448929daa7d4c5a9a00df9842c2c5aa91
Reviewed-on: https://gerrit.libreoffice.org/14558
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index dd9eaf8..13855e6 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -590,8 +590,11 @@ void ScDocShell::Execute( SfxRequest rReq )
 
 if ( bDo )
 {
-if ( pChangeTrack-IsProtected() )
-bDo = ExecuteChangeProtectionDialog( NULL );
+if (pChangeTrack)
+{
+if ( pChangeTrack-IsProtected() )
+bDo = ExecuteChangeProtectionDialog( NULL 
);
+}
 if ( bDo )
 {
 pDoc-EndChangeTracking();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sc/source

2015-02-19 Thread Laurent Godard
 sc/source/ui/docshell/docsh4.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 36578765e206ec963988d75e8a53adca0c981bc8
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Thu Feb 19 10:45:26 2015 +0100

tdf#89460 test pChangeTrack before using it

Change-Id: Ic02351c448929daa7d4c5a9a00df9842c2c5aa91
Reviewed-on: https://gerrit.libreoffice.org/14553
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com
(cherry picked from commit bf5c5f359cf4eb36a0a9a1110ec2aa3393bb87df)
Reviewed-on: https://gerrit.libreoffice.org/14557

diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 948e170..1a1c6f8e 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -586,8 +586,11 @@ void ScDocShell::Execute( SfxRequest rReq )
 
 if ( bDo )
 {
-if ( pChangeTrack-IsProtected() )
-bDo = ExecuteChangeProtectionDialog( NULL );
+if (pChangeTrack)
+{
+if ( pChangeTrack-IsProtected() )
+bDo = ExecuteChangeProtectionDialog( NULL );
+}
 if ( bDo )
 {
 rDoc.EndChangeTracking();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sc/source

2015-02-19 Thread Laurent Godard
 sc/source/ui/docshell/docsh4.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit bf5c5f359cf4eb36a0a9a1110ec2aa3393bb87df
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Thu Feb 19 10:45:26 2015 +0100

tdf#89460 test pChangeTrack before using it

Change-Id: Ic02351c448929daa7d4c5a9a00df9842c2c5aa91
Reviewed-on: https://gerrit.libreoffice.org/14553
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 2078e7b..9d9ef86 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -586,8 +586,11 @@ void ScDocShell::Execute( SfxRequest rReq )
 
 if ( bDo )
 {
-if ( pChangeTrack-IsProtected() )
-bDo = ExecuteChangeProtectionDialog( NULL );
+if (pChangeTrack)
+{
+if ( pChangeTrack-IsProtected() )
+bDo = ExecuteChangeProtectionDialog( NULL );
+}
 if ( bDo )
 {
 rDoc.EndChangeTracking();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: basctl/source

2015-02-12 Thread Laurent Godard
 basctl/source/basicide/baside2.cxx  |   29 +
 basctl/source/basicide/baside2.hxx  |2 
 basctl/source/basicide/baside2b.cxx |   78 +++-
 basctl/source/basicide/basobj3.cxx  |2 
 4 files changed, 83 insertions(+), 28 deletions(-)

New commits:
commit d8a9c74f41355362997c7f8b58942936a4a6d262
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Fri Feb 6 17:51:21 2015 +0100

BASIC IDE : add the current procedure name in the status bar

Change-Id: Icecef1748bcc964670b0b95263314d9d8a4555f0
Reviewed-on: https://gerrit.libreoffice.org/14367
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/basctl/source/basicide/baside2.cxx 
b/basctl/source/basicide/baside2.cxx
index c468932..af77aec 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -1118,6 +1118,35 @@ void ModulWindow::GetState( SfxItemSet rSet )
 }
 }
 break;
+case SID_BASICIDE_STAT_TITLE:
+{
+// search for current procedure name (Sub or Function)
+TextView* pView = GetEditView();
+if ( pView )
+{
+
+OUString sProcName;
+bool bFound = false;
+
+TextSelection aSel = pView-GetSelection();
+long nLine = aSel.GetStart().GetPara();
+
+for (long i = nLine; i = 0  !bFound; --i)
+{
+OUString aCurrLine = GetEditEngine()-GetText( i );
+OUString sProcType;
+bFound = GetEditorWindow().GetProcedureName(aCurrLine, 
sProcType, sProcName);
+}
+
+OUString aTitle = CreateQualifiedName();
+if (!sProcName.isEmpty())
+aTitle += . + sProcName;
+
+SfxStringItem aTitleItem( SID_BASICIDE_STAT_TITLE, aTitle 
);
+rSet.Put( aTitleItem );
+}
+}
+break;
 case SID_ATTR_INSERT:
 {
 TextView* pView = GetEditView();
diff --git a/basctl/source/basicide/baside2.hxx 
b/basctl/source/basicide/baside2.hxx
index 1008643..2247820 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -156,6 +156,8 @@ public:
 boolCanModify() { return ImpCanModify(); }
 
 voidUpdateSyntaxHighlighting ();
+
+boolGetProcedureName(OUString rLine, OUString rProcType, 
OUString rProcName);
 };
 
 
diff --git a/basctl/source/basicide/baside2b.cxx 
b/basctl/source/basicide/baside2b.cxx
index 31721b1..0aadfea 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -428,6 +428,7 @@ void EditorWindow::MouseButtonUp( const MouseEvent rEvt )
 if (SfxBindings* pBindings = GetBindingsPtr())
 {
 pBindings-Invalidate( SID_BASICIDE_STAT_POS );
+pBindings-Invalidate( SID_BASICIDE_STAT_TITLE );
 }
 }
 }
@@ -567,8 +568,12 @@ void EditorWindow::KeyInput( const KeyEvent rKEvt )
 if (SfxBindings* pBindings = GetBindingsPtr())
 {
 pBindings-Invalidate( SID_BASICIDE_STAT_POS );
+pBindings-Invalidate( SID_BASICIDE_STAT_TITLE );
 if ( rKEvt.GetKeyCode().GetGroup() == KEYGROUP_CURSOR )
+{
 pBindings-Update( SID_BASICIDE_STAT_POS );
+pBindings-Update( SID_BASICIDE_STAT_TITLE );
+}
 if ( !bWasModified  pEditEngine-IsModified() )
 {
 pBindings-Invalidate( SID_SAVEDOC );
@@ -729,42 +734,19 @@ void EditorWindow::HandleAutoCloseDoubleQuotes()
 
 void EditorWindow::HandleProcedureCompletion()
 {
+
 TextSelection aSel = GetEditView()-GetSelection();
 sal_uLong nLine = aSel.GetStart().GetPara();
 OUString aLine( pEditEngine-GetText( nLine ) );
 
-std::vectorHighlightPortion aPortions;
-aHighlighter.getHighlightPortions( aLine, aPortions );
-
-if( aPortions.empty() )
-return;
-
+bool bFoundName = false;
 OUString sProcType;
 OUString sProcName;
-bool bFoundType = false;
-bool bFoundName = false;
-
-for (std::vectorHighlightPortion::iterator i(aPortions.begin());
- i != aPortions.end(); ++i)
-{
-OUString sTokStr = aLine.copy(i-nBegin, i-nEnd - i-nBegin);
 
-if( i-tokenType == 9  ( sTokStr.equalsIgnoreAsciiCase(sub)
-|| sTokStr.equalsIgnoreAsciiCase(function)) )
-{
-sProcType = sTokStr;
-bFoundType = true;
-}
-if( i-tokenType == 1  bFoundType )
-{
-sProcName = sTokStr;
-bFoundName = true;
-break;
-}
-}
+bFoundName = GetProcedureName(aLine

[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - desktop/source

2015-01-20 Thread Laurent Godard
 desktop/source/app/dispatchwatcher.cxx |   37 +++--
 1 file changed, 22 insertions(+), 15 deletions(-)

New commits:
commit ef93d0ccb0c2ef010fc1f1089e55f1d9c74e61fd
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Thu Jan 15 18:40:47 2015 +0100

executeDispatchRequests : cleaning outputs

- replace RTL_TEXTENCODING_UTF8 with osl_getThreadTextEncoding()
- replace printf statements with std::cerr and std::cout

Change-Id: Id374efac90f86bbfdc817f2266a5c995d72902e4
(cherry picked from commit 905bab9e46f9a15d4402954b70913d66fc6d3cd5)
Reviewed-on: https://gerrit.libreoffice.org/14042
Tested-by: Michael Stahl mst...@redhat.com
Reviewed-by: Michael Stahl mst...@redhat.com

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index 2480c69..80eb9b6 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -139,7 +139,12 @@ const SfxFilter* impl_getExportFilterFromUrl( const 
rtl::OUString rUrl, const r
 pFilter = impl_lookupExportFilterForUrl( rUrl, rFactory );
 if ( !pFilter )
 {
-std::cerr  Error:  no export filter for   rUrl   found, now 
using the default filter for   rFactory  \n;
+OUString aTempName;
+FileBase::getSystemPathFromFileURL( rUrl, aTempName );
+OString aSource = OUStringToOString ( aTempName, 
osl_getThreadTextEncoding() );
+OString aFactory = OUStringToOString ( rFactory, 
osl_getThreadTextEncoding() );
+std::cerr  Error:  no export filter for   aSource   found, 
now using the default filter for   aFactory  std::endl;
+
 pFilter = SfxFilter::GetDefaultFilterFromFactory( rFactory );
 }
 
@@ -513,7 +518,7 @@ bool DispatchWatcher::executeDispatchRequests( const 
DispatchList aDispatchRequ
 if( aDispatchRequest.aRequestType == REQUEST_CAT )
 {
 if( ::osl::FileBase::createTempFile(0, 0, 
fileForCat) != ::osl::FileBase::E_None )
-fprintf( stderr, Error: Cannot create 
temporary file...\n );
+std::cerr  Error: Cannot create 
temporary file...  std::endl ;
 aOutFile = fileForCat;
 }
 
@@ -549,15 +554,15 @@ bool DispatchWatcher::executeDispatchRequests( const 
DispatchList aDispatchRequ
 
 OUString aTempName;
 FileBase::getSystemPathFromFileURL( aName, 
aTempName );
-OString aSource8 = OUStringToOString ( aTempName, 
RTL_TEXTENCODING_UTF8 );
+OString aSource8 = OUStringToOString ( aTempName, 
osl_getThreadTextEncoding() );
 FileBase::getSystemPathFromFileURL( aOutFile, 
aTempName );
-OString aTargetURL8 = OUStringToOString(aTempName, 
RTL_TEXTENCODING_UTF8 );
+OString aTargetURL8 = OUStringToOString(aTempName, 
osl_getThreadTextEncoding() );
 if( aDispatchRequest.aRequestType != REQUEST_CAT )
 {
-printf(convert %s - %s using %s\n, 
aSource8.getStr(), aTargetURL8.getStr(),
-   OUStringToOString( aFilter, 
RTL_TEXTENCODING_UTF8 ).getStr());
+std::cout  convert   aSource8   -  
 aTargetURL8;
+std::cout   using filter :   
OUStringToOString( aFilter, osl_getThreadTextEncoding() )  std::endl;
 if( FStatHelper::IsDocument( aOutFile ) )
-printf(Overwriting: 
%s\n,OUStringToOString( aTempName, RTL_TEXTENCODING_UTF8 ).getStr() );
+std::cout  Overwriting:   
OUStringToOString( aTempName, osl_getThreadTextEncoding() )  std::endl ;
 }
 try
 {
@@ -577,7 +582,7 @@ bool DispatchWatcher::executeDispatchRequests( const 
DispatchList aDispatchRequ
 osl::File::RC aRC = aFile.open( 
osl_File_OpenFlag_Read );
 if( aRC != osl::File::E_None )
 {
-fprintf( stderr, Error: Cannot read from 
temp file\n );
+std::cerr  Error: Cannot read from temp 
file  std::endl;
 }
 else
 {
@@ -594,7 +599,7 @@ bool DispatchWatcher::executeDispatchRequests( const 
DispatchList aDispatchRequ
 {
 std::cout  aStr[i

[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - desktop/source

2015-01-20 Thread Laurent Godard
 desktop/source/app/dispatchwatcher.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 1989572b219966bf0ba8fd6809adca19c22d3057
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Tue Jan 13 15:27:59 2015 +0100

convert-to : display error messages in console fdo#88326

- source file does not exist
- requested export filter does not exist and we use default filter (still 
process though)

Change-Id: I92031ea305e81927357acfc352dbe5a5da205b0d
(cherry picked from commit de900ebdd4fec0fb06d56583ae22b2adc3608a65)
Reviewed-on: https://gerrit.libreoffice.org/14041
Tested-by: Michael Stahl mst...@redhat.com
Reviewed-by: Michael Stahl mst...@redhat.com

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index 0cc179b..2480c69 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -139,7 +139,7 @@ const SfxFilter* impl_getExportFilterFromUrl( const 
rtl::OUString rUrl, const r
 pFilter = impl_lookupExportFilterForUrl( rUrl, rFactory );
 if ( !pFilter )
 {
-SAL_INFO( desktop.app, no export filter for   rUrl  found, 
using the default filter for   rFactory );
+std::cerr  Error:  no export filter for   rUrl   found, now 
using the default filter for   rFactory  \n;
 pFilter = SfxFilter::GetDefaultFilterFromFactory( rFactory );
 }
 
@@ -565,7 +565,7 @@ bool DispatchWatcher::executeDispatchRequests( const 
DispatchList aDispatchRequ
 }
 catch (const Exception rException)
 {
-std::cerr  Error: Please reverify input 
parameters...;
+std::cerr  Error: Please verify input 
parameters...;
 if (!rException.Message.isEmpty())
 std::cerr   (  rException.Message  
);
 std::cerr  std::endl;
@@ -663,7 +663,7 @@ bool DispatchWatcher::executeDispatchRequests( const 
DispatchList aDispatchRequ
 }
 else
 {
-// place error message here ...
+std::cerr  (Error: source file could not be loaded\n);
 }
 
 // remove the document
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/source

2015-01-19 Thread Laurent Godard
 desktop/source/app/dispatchwatcher.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit de900ebdd4fec0fb06d56583ae22b2adc3608a65
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Tue Jan 13 15:27:59 2015 +0100

convert-to : display error messages in console fdo#88326

- source file does not exist
- requested export filter does not exist and we use default filter (still 
process though)

Change-Id: I92031ea305e81927357acfc352dbe5a5da205b0d

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index 0cc179b..2480c69 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -139,7 +139,7 @@ const SfxFilter* impl_getExportFilterFromUrl( const 
rtl::OUString rUrl, const r
 pFilter = impl_lookupExportFilterForUrl( rUrl, rFactory );
 if ( !pFilter )
 {
-SAL_INFO( desktop.app, no export filter for   rUrl  found, 
using the default filter for   rFactory );
+std::cerr  Error:  no export filter for   rUrl   found, now 
using the default filter for   rFactory  \n;
 pFilter = SfxFilter::GetDefaultFilterFromFactory( rFactory );
 }
 
@@ -565,7 +565,7 @@ bool DispatchWatcher::executeDispatchRequests( const 
DispatchList aDispatchRequ
 }
 catch (const Exception rException)
 {
-std::cerr  Error: Please reverify input 
parameters...;
+std::cerr  Error: Please verify input 
parameters...;
 if (!rException.Message.isEmpty())
 std::cerr   (  rException.Message  
);
 std::cerr  std::endl;
@@ -663,7 +663,7 @@ bool DispatchWatcher::executeDispatchRequests( const 
DispatchList aDispatchRequ
 }
 else
 {
-// place error message here ...
+std::cerr  (Error: source file could not be loaded\n);
 }
 
 // remove the document
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/source

2015-01-19 Thread Laurent Godard
 desktop/source/app/dispatchwatcher.cxx |   37 +++--
 1 file changed, 22 insertions(+), 15 deletions(-)

New commits:
commit 905bab9e46f9a15d4402954b70913d66fc6d3cd5
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Thu Jan 15 18:40:47 2015 +0100

executeDispatchRequests : cleaning outputs

- replace RTL_TEXTENCODING_UTF8 with osl_getThreadTextEncoding()
- replace printf statements with std::cerr and std::cout

Change-Id: Id374efac90f86bbfdc817f2266a5c995d72902e4

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index 2480c69..80eb9b6 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -139,7 +139,12 @@ const SfxFilter* impl_getExportFilterFromUrl( const 
rtl::OUString rUrl, const r
 pFilter = impl_lookupExportFilterForUrl( rUrl, rFactory );
 if ( !pFilter )
 {
-std::cerr  Error:  no export filter for   rUrl   found, now 
using the default filter for   rFactory  \n;
+OUString aTempName;
+FileBase::getSystemPathFromFileURL( rUrl, aTempName );
+OString aSource = OUStringToOString ( aTempName, 
osl_getThreadTextEncoding() );
+OString aFactory = OUStringToOString ( rFactory, 
osl_getThreadTextEncoding() );
+std::cerr  Error:  no export filter for   aSource   found, 
now using the default filter for   aFactory  std::endl;
+
 pFilter = SfxFilter::GetDefaultFilterFromFactory( rFactory );
 }
 
@@ -513,7 +518,7 @@ bool DispatchWatcher::executeDispatchRequests( const 
DispatchList aDispatchRequ
 if( aDispatchRequest.aRequestType == REQUEST_CAT )
 {
 if( ::osl::FileBase::createTempFile(0, 0, 
fileForCat) != ::osl::FileBase::E_None )
-fprintf( stderr, Error: Cannot create 
temporary file...\n );
+std::cerr  Error: Cannot create 
temporary file...  std::endl ;
 aOutFile = fileForCat;
 }
 
@@ -549,15 +554,15 @@ bool DispatchWatcher::executeDispatchRequests( const 
DispatchList aDispatchRequ
 
 OUString aTempName;
 FileBase::getSystemPathFromFileURL( aName, 
aTempName );
-OString aSource8 = OUStringToOString ( aTempName, 
RTL_TEXTENCODING_UTF8 );
+OString aSource8 = OUStringToOString ( aTempName, 
osl_getThreadTextEncoding() );
 FileBase::getSystemPathFromFileURL( aOutFile, 
aTempName );
-OString aTargetURL8 = OUStringToOString(aTempName, 
RTL_TEXTENCODING_UTF8 );
+OString aTargetURL8 = OUStringToOString(aTempName, 
osl_getThreadTextEncoding() );
 if( aDispatchRequest.aRequestType != REQUEST_CAT )
 {
-printf(convert %s - %s using %s\n, 
aSource8.getStr(), aTargetURL8.getStr(),
-   OUStringToOString( aFilter, 
RTL_TEXTENCODING_UTF8 ).getStr());
+std::cout  convert   aSource8   -  
 aTargetURL8;
+std::cout   using filter :   
OUStringToOString( aFilter, osl_getThreadTextEncoding() )  std::endl;
 if( FStatHelper::IsDocument( aOutFile ) )
-printf(Overwriting: 
%s\n,OUStringToOString( aTempName, RTL_TEXTENCODING_UTF8 ).getStr() );
+std::cout  Overwriting:   
OUStringToOString( aTempName, osl_getThreadTextEncoding() )  std::endl ;
 }
 try
 {
@@ -577,7 +582,7 @@ bool DispatchWatcher::executeDispatchRequests( const 
DispatchList aDispatchRequ
 osl::File::RC aRC = aFile.open( 
osl_File_OpenFlag_Read );
 if( aRC != osl::File::E_None )
 {
-fprintf( stderr, Error: Cannot read from 
temp file\n );
+std::cerr  Error: Cannot read from temp 
file  std::endl;
 }
 else
 {
@@ -594,7 +599,7 @@ bool DispatchWatcher::executeDispatchRequests( const 
DispatchList aDispatchRequ
 {
 std::cout  aStr[i];
 }
-std::cout  \n;
+std::cout  std::endl;
 }
 aFile.close();
 osl::File::remove

[Libreoffice-commits] core.git: bin/parse-perfcheck.py

2014-11-17 Thread Laurent Godard
 bin/parse-perfcheck.py |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ad91cfdcf256f5af159f2f18d3b83f17b91849dc
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Fri Nov 14 18:11:08 2014 +0100

parse-perfcheck : add filename to csv results

one can find callgrind output file more easilly

Change-Id: Ic5019d5259a63ab23ed44d39baaeb7432690382e
Reviewed-on: https://gerrit.libreoffice.org/12450
Reviewed-by: Riccardo Magliocchetti riccardo.magliocche...@gmail.com
Tested-by: Riccardo Magliocchetti riccardo.magliocche...@gmail.com

diff --git a/bin/parse-perfcheck.py b/bin/parse-perfcheck.py
index 71f248c..ea10adf 100755
--- a/bin/parse-perfcheck.py
+++ b/bin/parse-perfcheck.py
@@ -47,14 +47,14 @@ def parseFile(dirname, filename, lastCommit):
 
   colsResult[lastCommitId]['values'][curTestComment] = total
 
-  return [lastCommitId, lastCommitDate, testName, curTestComment, total]
+  return [lastCommitId, lastCommitDate, testName, curTestComment, total, 
filename]
 
 def processDirectory(rootDir, needsCsvHeader, lastCommit):
 
 results = []
 
 if needsCsvHeader:
-results.append([lastCommit, lastCommitDate, test filename, dump 
comment, count])
+results.append([lastCommit, lastCommitDate, test filename, dump 
comment, count, filename])
 
 for dirName, subdirList, fileList in os.walk(rootDir):
 files = [f for f in fileList if f.startswith(callgrind.out.)]
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sc/CppunitTest_sc_perfobj.mk sc/Module_sc.mk sc/qa

2014-11-13 Thread Laurent Godard
 sc/CppunitTest_sc_perfobj.mk   |   77 +
 sc/Module_sc.mk|4 
 sc/qa/perf/scperfobj.cxx   |  255 +
 sc/qa/perf/testdocuments/scBigFile.ods |binary
 4 files changed, 335 insertions(+), 1 deletion(-)

New commits:
commit 4ef9e07c6526ac2e36f9d10a81da264f0b205920
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Mon Nov 3 16:01:07 2014 +0100

calc performance test

- a plain perfcheck test example on big file
  - searches
  - named ranges
  - sheets
- big file is approx.
  - 100 sheets
  - 60k values in a sheets
  - 5k named ranges
  - 2k formulas (calling named ranges)

Change-Id: I61970f3387d400ed6737a369ead6daf896afacdc

diff --git a/sc/CppunitTest_sc_perfobj.mk b/sc/CppunitTest_sc_perfobj.mk
new file mode 100644
index 000..decabe0
--- /dev/null
+++ b/sc/CppunitTest_sc_perfobj.mk
@@ -0,0 +1,77 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+#*
+
+$(eval $(call gb_CppunitTest_CppunitTest,sc_perfobj))
+
+$(eval $(call gb_CppunitTest_use_external,sc_perfobj,boost_headers))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sc_perfobj, \
+sc/qa/perf/scperfobj \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sc_perfobj, \
+basegfx \
+comphelper \
+cppu \
+cppuhelper \
+drawinglayer \
+editeng \
+for \
+forui \
+i18nlangtag \
+msfilter \
+oox \
+sal \
+salhelper \
+sax \
+sb \
+sc \
+sfx \
+sot \
+subsequenttest \
+svl \
+svt \
+svx \
+svxcore \
+test \
+tk \
+tl \
+ucbhelper \
+unotest \
+utl \
+vbahelper \
+vcl \
+xo \
+$(gb_UWINAPI) \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sc_perfobj,\
+-I$(SRCDIR)/sc/source/ui/inc \
+-I$(SRCDIR)/sc/inc \
+$$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,sc_perfobj,\
+offapi \
+udkapi \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,sc_perfobj))
+$(eval $(call gb_CppunitTest_use_vcl,sc_perfobj))
+
+
+$(eval $(call gb_CppunitTest_use_rdb,sc_perfobj,services))
+
+$(eval $(call gb_CppunitTest_use_configuration,sc_perfobj))
+
+$(eval $(call gb_CppunitTest_use_unittest_configuration,sc_perfobj))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index 3f57318..9385dc5 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -85,7 +85,9 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\
 ))
 
 $(eval $(call gb_Module_add_perfcheck_targets,sc,\
-   CppunitTest_sc_tablesheetobj \
+CppunitTest_sc_perfobj \
+CppunitTest_sc_tablesheetobj \
 ))
 
+
 # vim: set noet sw=4 ts=4:
diff --git a/sc/qa/perf/scperfobj.cxx b/sc/qa/perf/scperfobj.cxx
new file mode 100644
index 000..b30a2c2
--- /dev/null
+++ b/sc/qa/perf/scperfobj.cxx
@@ -0,0 +1,255 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include test/calc_unoapi_test.hxx
+
+#include rtl/ustring.hxx
+#include cppunit/extensions/HelperMacros.h
+
+#include com/sun/star/util/XSearchable.hpp
+#include com/sun/star/util/XSearchDescriptor.hpp
+#include com/sun/star/container/XIndexAccess.hpp
+#include com/sun/star/sheet/XSpreadsheetDocument.hpp
+#include com/sun/star/sheet/XSpreadsheet.hpp
+#include com/sun/star/sheet/XSpreadsheets.hpp
+
+#include com/sun/star/beans/XPropertySet.hpp
+#include com/sun/star/table/XCellRange.hpp
+#include com/sun/star/sheet/XCellRangeAddressable.hpp
+#include com/sun/star/sheet/XCellRangeReferrer.hpp
+#include com/sun/star/sheet/XNamedRanges.hpp
+#include com/sun/star/sheet/XNamedRange.hpp
+#include com/sun/star/table/XCell.hpp
+#include com/sun/star/text/XTextRange.hpp
+#include com/sun/star/table/CellAddress.hpp
+#include com/sun/star/table/CellRangeAddress.hpp
+#include com/sun/star/sheet/Border.hpp
+#include com/sun/star/sheet/NamedRangeFlag.hpp
+
+#include test/callgrind.hxx
+
+using namespace css;
+using namespace css::uno;
+
+namespace sc_apitest {
+
+#define NUMBER_OF_TESTS 3
+
+class ScPerfObj : public CalcUnoApiTest
+{
+public:
+
+ScPerfObj();
+
+virtual void setUp() SAL_OVERRIDE;
+virtual void tearDown() SAL_OVERRIDE;
+
+uno::Reference uno::XInterface  init();
+
+CPPUNIT_TEST_SUITE(ScPerfObj

[Libreoffice-commits] core.git: sc/Module_sc.mk test/source

2014-11-12 Thread Laurent Godard
 sc/Module_sc.mk   |4 
 test/source/util/xreplaceable.cxx |4 
 2 files changed, 8 insertions(+)

New commits:
commit e65790ddcf90ee243bf74f8f906c7b12a7fda901
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Tue Nov 4 12:36:46 2014 +0100

perfcheck instrument existing test : replaceAll

Change-Id: I7766aa6d69810124b27763912c3e7a8399637280
Reviewed-on: https://gerrit.libreoffice.org/12243
Reviewed-by: Matúš Kukan matus.ku...@collabora.com
Tested-by: Matúš Kukan matus.ku...@collabora.com

diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index 56f02da..3f57318 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -84,4 +84,8 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\
 CppunitTest_sc_modelobj \
 ))
 
+$(eval $(call gb_Module_add_perfcheck_targets,sc,\
+   CppunitTest_sc_tablesheetobj \
+))
+
 # vim: set noet sw=4 ts=4:
diff --git a/test/source/util/xreplaceable.cxx 
b/test/source/util/xreplaceable.cxx
index 42a3110..598a7dd 100644
--- a/test/source/util/xreplaceable.cxx
+++ b/test/source/util/xreplaceable.cxx
@@ -16,6 +16,8 @@
 
 #include iostream
 
+#include test/callgrind.hxx
+
 using namespace css;
 using namespace css::uno;
 
@@ -50,7 +52,9 @@ void XReplaceable::testReplaceAll()
 xReplaceDescr-setSearchString(maSearchString);
 xReplaceDescr-setReplaceString(maReplaceString);
 
+callgrindStart();
 xReplaceable-replaceAll(uno::Reference util::XSearchDescriptor 
(xReplaceDescr, UNO_QUERY_THROW));
+callgrindDump(replaceAll);
 
 //check that now at least one element is found
 xElement = xReplaceable-findFirst(xSearchDescr);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/parse-perfcheck.py

2014-11-12 Thread Laurent Godard
 bin/parse-perfcheck.py |  264 -
 1 file changed, 216 insertions(+), 48 deletions(-)

New commits:
commit 8fa8bb641f63d88e67cafe90f0606905150b644e
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Thu Oct 30 16:29:45 2014 +0100

Parse perfcheck results

refactoring arguments
process csv file only if newer commits
add columned output
calculate deltas  alert messages

Change-Id: Ib7ba87e9cb55b03ac8665db7a8dc302d2e8611a0
Reviewed-on: https://gerrit.libreoffice.org/12155
Reviewed-by: Matúš Kukan matus.ku...@collabora.com
Tested-by: Matúš Kukan matus.ku...@collabora.com

diff --git a/bin/parse-perfcheck.py b/bin/parse-perfcheck.py
index afa22a4..ea74c04 100755
--- a/bin/parse-perfcheck.py
+++ b/bin/parse-perfcheck.py
@@ -7,7 +7,6 @@
 
 import sys
 import os
-import time
 
 parseTrigger = desc: Trigger: Client Request: 
 parseTotal = totals: 
@@ -15,12 +14,16 @@ parseTotal = totals: 
 separator = os.path.sep
 
 lastCommitId = 
-needsCsvHeader = True
+lastCommitDate = 
+needsCsvHeader = True # needs header in csv file ? yes if new
+
+colsResult = {}
+allTests = []
 
 def processDirectory(rootDir):
 
   if needsCsvHeader:
-intermediateResult = lastCommit\ttest name\tfiledatetime\tdump 
comment\tcount\n
+intermediateResult = lastCommit\tlastCommitDate\ttest filename\tdump 
comment\tcount\n
   else:
intermediateResult = 
 
@@ -40,86 +43,251 @@ def parseFile(dirname, filename):
   callgrindFile = open(path,'r')
   lines = callgrindFile.readlines()
 
-  message = 
-  total = 
+  curTestComment = 
+  total = 0
 
   for line in lines:
 if line.startswith(parseTrigger):
-  message = line[len(parseTrigger):]
+  curTestComment = line[len(parseTrigger):].replace(\n,)
 elif line.startswith(parseTotal):
-  total = line[len(parseTotal):]
+  total = line[len(parseTotal):].replace(\n,)
 
   callgrindFile.close()
 
-  if message ==  and total == 0\n:
+  if curTestComment == :
+return 
+
+  if total == 0: # should not occur, btw
 return 
 
   dirs = dirname.split(separator)
   currentTest = dirs[-1:]
   testName = currentTest[0].replace(.test.core,)
 
-  message = message.replace(\n,)
+  if lastCommitId not in colsResult:
+colsResult[lastCommitId] = {}
+colsResult[lastCommitId]['date'] = lastCommitDate
+colsResult[lastCommitId]['values'] = {}
 
-  fileDate = time.strftime('%m/%d/%Y %H:%M:%S', 
time.gmtime(os.path.getmtime(path)))
+  colsResult[lastCommitId]['values'][curTestComment] = total
 
-  result = lastCommitId + \t + testName + \t + fileDate + \t + message + 
\t + total
+  result = lastCommitId + \t + lastCommitDate + \t + testName + \t + 
curTestComment + \t + total + \n
 
   return result
 
-def getLastCommitId():
+def getLastCommitInfo():
 
-  stream = os.popen(git log)
+  stream = os.popen(git log --date=iso)
+  line = stream.readline()
+  commitId = line.replace(commit ,).replace(\n,)
+  line = stream.readline()
   line = stream.readline()
-  return line.replace(commit ,).replace(\n,)
+  commitDate = line.replace(Date: ,).replace(\n,).strip()
+
+  return commitId, commitDate
 
 def displayUsage():
 
-  print
-  print Parses the callgrind results of make percheck
-  print
-  print Usage: bin/parse_perfcheck.py [targetFileName = perfcheckResult.csv] 
[sourceDirectory = ./workdir/CppunitTest]
-  print default assumes running from core root directory
-  print
+  usage = 
+
+Parses the callgrind results of make percheck
+
+Arguments :
+
+  --csv-file\t\t the target CSV file - new or containing previous tests - 
default : perfcheckResult.csv
+  --source-directory\t directory containing make perfcheck output - default : 
./workdir/CppunitTest
+  --alert-type\t\t mode for calculating alerts - valid values : previous first
+  --alert-value\t\t alert threshold in % - default = 10
+
+  --help\t\t this message
+
+Columned output is dumped into csv-file + .col
+
+Alerts, if any, are displayed in standard output
+
+
+  print(usage)
+
+def analyzeArgs(args):
+
+isValid = True
+
+targetFileName = perfcheckResult.csv
+sourceDirectory = ./workdir/CppunitTest
+alertType = 
+alertValue = 10
+
+if --help in args:
+  isValid = False
+
+if isValid:
+
+  for arg in args[1:]:
+
+found = False
+
+if arg.startswith(--csv-file):
+  spliter = arg.split(=)
+  if spliter[1] != :
+targetFileName = spliter[1]
+found = True
+
+elif arg.startswith(--source-directory):
+  spliter = arg.split(=)
+  if spliter[1] != :
+sourceDirectory = spliter[1]
+found = True
+
+elif arg.startswith(--alert-type):
+  spliter = arg.split(=)
+  if spliter[1] in ['previous','first']:
+alertType = spliter[1]
+found = True
+  else:
+isValid = False
+
+elif arg.startswith(--alert-value):
+  spliter

[Libreoffice-commits] core.git: sc/source

2014-11-12 Thread Laurent Godard
 sc/source/ui/docshell/docfunc.cxx |   11 +--
 sc/source/ui/inc/docfunc.hxx  |4 ++--
 2 files changed, 7 insertions(+), 8 deletions(-)

New commits:
commit fa18fd06e0d9de3eb87f3bdec4aa00a587c9fd5f
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Wed Nov 12 12:43:40 2014 +0100

calc SetNewRangeNames remove useless bool type

Change-Id: I0c8bca04c3d0e318caacfbfa306284153305d8eb
Reviewed-on: https://gerrit.libreoffice.org/12381
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/sc/source/ui/docshell/docfunc.cxx 
b/sc/source/ui/docshell/docfunc.cxx
index 1d5a94f..4657302 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -4818,12 +4818,12 @@ bool ScDocFunc::UnmergeCells( const ScCellMergeOption 
rOption, bool bRecord )
 return true;
 }
 
-bool ScDocFunc::ModifyRangeNames( const ScRangeName rNewRanges, SCTAB nTab )
+void ScDocFunc::ModifyRangeNames( const ScRangeName rNewRanges, SCTAB nTab )
 {
-return SetNewRangeNames( new ScRangeName(rNewRanges), true, nTab );
+SetNewRangeNames( new ScRangeName(rNewRanges), true, nTab );
 }
 
-bool ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc, 
SCTAB nTab ) // takes ownership of pNewRanges
+void ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc, 
SCTAB nTab ) // takes ownership of pNewRanges
 {
 ScDocShellModificator aModificator( rDocShell );
 
@@ -4867,8 +4867,6 @@ bool ScDocFunc::SetNewRangeNames( ScRangeName* 
pNewRanges, bool bModifyDoc, SCTA
 aModificator.SetDocumentModified();
 SfxGetpApp()-Broadcast( SfxSimpleHint(SC_HINT_AREAS_CHANGED) );
 }
-
-return true;
 }
 
 void ScDocFunc::ModifyAllRangeNames( const boost::ptr_mapOUString, 
ScRangeName rRangeMap )
@@ -5037,7 +5035,8 @@ bool ScDocFunc::CreateNames( const ScRange rRange, 
sal_uInt16 nFlags, bool bApi
 if ( bBottom  bRight )
 CreateOneName( aNewRanges, nEndCol,nEndRow,nTab, 
nContX1,nContY1,nContX2,nContY2, bCancel, bApi );
 
-bDone = ModifyRangeNames( aNewRanges, aTab );
+ModifyRangeNames( aNewRanges, aTab );
+bDone = true;
 
 aModificator.SetDocumentModified();
 SfxGetpApp()-Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx
index 5cd2513..6f970eb 100644
--- a/sc/source/ui/inc/docfunc.hxx
+++ b/sc/source/ui/inc/docfunc.hxx
@@ -193,8 +193,8 @@ public:
 boolUnmergeCells( const ScRange rRange, bool bRecord );
 boolUnmergeCells( const ScCellMergeOption rOption, bool 
bRecord );
 
-boolSetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc 
= true, SCTAB nTab = -1 ); // takes ownership of pNewRanges //nTab = -1 for 
local range names
-boolModifyRangeNames( const ScRangeName rNewRanges, SCTAB 
nTab = -1 );
+voidSetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc 
= true, SCTAB nTab = -1 ); // takes ownership of pNewRanges //nTab = -1 for 
local range names
+voidModifyRangeNames( const ScRangeName rNewRanges, SCTAB 
nTab = -1 );
 /**
  * Modify all range names, global scope names as well as sheet local ones,
  * in one go.  Note that this method will bnot/b destroy the instances
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sc/source

2014-11-12 Thread Laurent Godard
 sc/source/ui/docshell/docfunc.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 187ffc5e9966c3f2c09965b5ab8ebb43e12300e9
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Fri Nov 7 15:30:03 2014 +0100

addNewFromTitles : avoid broadcasting SC_HINT_AREAS_CHANGED twice

as it is already done in subsequent calls (in ModifyRangeNames -- 
SetNewRangeNames)

perfchek result
before : 899399452
after :  645684676

Change-Id: I29b8add457c3177e63df29f93be7a11dacde4953
Reviewed-on: https://gerrit.libreoffice.org/12302
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/sc/source/ui/docshell/docfunc.cxx 
b/sc/source/ui/docshell/docfunc.cxx
index 4657302..9cd90e8 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -5038,8 +5038,6 @@ bool ScDocFunc::CreateNames( const ScRange rRange, 
sal_uInt16 nFlags, bool bApi
 ModifyRangeNames( aNewRanges, aTab );
 bDone = true;
 
-aModificator.SetDocumentModified();
-SfxGetpApp()-Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
 }
 
 return bDone;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - sc/inc sc/source

2014-11-04 Thread Laurent Godard
 sc/inc/table.hxx   |3 +++
 sc/source/core/data/table6.cxx |   26 +-
 2 files changed, 24 insertions(+), 5 deletions(-)

New commits:
commit fd1b1a153516934699cd7d87437b13511c9f9d14
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Tue Nov 4 12:42:15 2014 +0100

 calc ScTable::ReplaceAll : avoid calling GetLastDataPos uselessly

Change-Id: Ibb6fb9ea3e524a889de96f560e308a4aa54fa2af
Reviewed-on: https://gerrit.libreoffice.org/12248
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index e4e7218..cf02241 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -496,10 +496,14 @@ bool ScTable::ReplaceAll(
 SCCOL nCol = 0;
 SCROW nRow = -1;
 
+SCCOL nLastCol;
+SCROW nLastRow;
+GetLastDataPos(nLastCol, nLastRow);
+
 bool bEverFound = false;
 while (true)
 {
-bool bFound = Search(rSearchItem, nCol, nRow, rMark, rUndoStr, 
pUndoDoc);
+bool bFound = Search(rSearchItem, nCol, nRow, nLastCol, nLastRow, 
rMark, rUndoStr, pUndoDoc);
 
 if (bFound)
 {
commit 99df39b5206be1d03416142c97e77ebfd823b9d5
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Mon Nov 3 17:19:35 2014 +0100

calc ScTable::SearchAll : avoid calling GetLastDataPos uselessly

in the loop we are in the same table
refactor ScTable::Search too

perfchek result for testSheetFindAll-Search value
before : 804252982
after :  229861999

Change-Id: I907f1260472bcc5d93b2c6425c342187a5f4c787
Reviewed-on: https://gerrit.libreoffice.org/12225
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index d396402..0b5adfa 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -994,6 +994,9 @@ private:
const ScMarkData rMark, OUString rUndoStr, 
ScDocument* pUndoDoc);
 boolSearch(const SvxSearchItem rSearchItem, SCCOL rCol, SCROW 
rRow,
const ScMarkData rMark, OUString rUndoStr, 
ScDocument* pUndoDoc);
+boolSearch(const SvxSearchItem rSearchItem, SCCOL rCol, SCROW 
rRow,
+   const SCCOL nLastCol, const SCROW nLastRow,
+   const ScMarkData rMark, OUString rUndoStr, 
ScDocument* pUndoDoc);
 boolSearchAll(const SvxSearchItem rSearchItem, const ScMarkData 
rMark,
   ScRangeList rMatchedRanges, OUString rUndoStr, 
ScDocument* pUndoDoc);
 boolReplace(const SvxSearchItem rSearchItem, SCCOL rCol, SCROW 
rRow,
diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index d9140ed..e4e7218 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -276,14 +276,22 @@ void ScTable::SkipFilteredRows(SCROW rRow, SCROW 
rLastNonFilteredRow, bool bFo
 bool ScTable::Search(const SvxSearchItem rSearchItem, SCCOL rCol, SCROW 
rRow,
  const ScMarkData rMark, OUString rUndoStr, ScDocument* 
pUndoDoc)
 {
+SCCOL nLastCol;
+SCROW nLastRow;
+GetLastDataPos(nLastCol, nLastRow);
+return Search(rSearchItem, rCol, rRow, nLastCol, nLastRow, rMark, 
rUndoStr, pUndoDoc);
+}
+
+bool ScTable::Search(const SvxSearchItem rSearchItem, SCCOL rCol, SCROW 
rRow,
+ const SCCOL nLastCol, const SCROW nLastRow,
+ const ScMarkData rMark, OUString rUndoStr, ScDocument* 
pUndoDoc)
+{
 bool bFound = false;
 bool bAll =  (rSearchItem.GetCommand() == SVX_SEARCHCMD_FIND_ALL)
||(rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE_ALL);
 SCCOL nCol = rCol;
 SCROW nRow = rRow;
-SCCOL nLastCol;
-SCROW nLastRow;
-GetLastDataPos(nLastCol, nLastRow);
+
 bool bSkipFiltered = !rSearchItem.IsSearchFiltered();
 if (!bAll  rSearchItem.GetBackward())
 {
@@ -429,9 +437,13 @@ bool ScTable::SearchAll(const SvxSearchItem rSearchItem, 
const ScMarkData rMar
 SCROW nRow = -1;
 bool bEverFound = false;
 
+SCCOL nLastCol;
+SCROW nLastRow;
+GetLastDataPos(nLastCol, nLastRow);
+
 do
 {
-bFound = Search(rSearchItem, nCol, nRow, rMark, rUndoStr, pUndoDoc);
+bFound = Search(rSearchItem, nCol, nRow, nLastCol, nLastRow, rMark, 
rUndoStr, pUndoDoc);
 if (bFound)
 {
 bEverFound = true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/parse-perfcheck.py

2014-10-29 Thread Laurent Godard
 bin/parse-perfcheck.py |  125 +
 1 file changed, 125 insertions(+)

New commits:
commit 4f5f6d2444a24138c3d3d378771f87cb06427195
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Tue Oct 14 09:50:39 2014 +0200

perfcheck : parse callgrind.out results to build csv file

appends results on existing target file

Change-Id: Icd897b090e1d1ed896b88a2f5923e8f35e95e5d2

diff --git a/bin/parse-perfcheck.py b/bin/parse-perfcheck.py
new file mode 100755
index 000..afa22a4
--- /dev/null
+++ b/bin/parse-perfcheck.py
@@ -0,0 +1,125 @@
+#!/usr/bin/python
+
+# This file is part of the LibreOffice project.
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+import sys
+import os
+import time
+
+parseTrigger = desc: Trigger: Client Request: 
+parseTotal = totals: 
+
+separator = os.path.sep
+
+lastCommitId = 
+needsCsvHeader = True
+
+def processDirectory(rootDir):
+
+  if needsCsvHeader:
+intermediateResult = lastCommit\ttest name\tfiledatetime\tdump 
comment\tcount\n
+  else:
+   intermediateResult = 
+
+  for dirName, subdirList, fileList in os.walk(rootDir):
+
+files = [ fi for fi in fileList if fi.startswith(callgrind.out.) ]
+for fname in files:
+found = parseFile(dirName, fname)
+if found != :
+  intermediateResult += found
+
+  return intermediateResult
+
+def parseFile(dirname, filename):
+
+  path = dirname + separator + filename
+  callgrindFile = open(path,'r')
+  lines = callgrindFile.readlines()
+
+  message = 
+  total = 
+
+  for line in lines:
+if line.startswith(parseTrigger):
+  message = line[len(parseTrigger):]
+elif line.startswith(parseTotal):
+  total = line[len(parseTotal):]
+
+  callgrindFile.close()
+
+  if message ==  and total == 0\n:
+return 
+
+  dirs = dirname.split(separator)
+  currentTest = dirs[-1:]
+  testName = currentTest[0].replace(.test.core,)
+
+  message = message.replace(\n,)
+
+  fileDate = time.strftime('%m/%d/%Y %H:%M:%S', 
time.gmtime(os.path.getmtime(path)))
+
+  result = lastCommitId + \t + testName + \t + fileDate + \t + message + 
\t + total
+
+  return result
+
+def getLastCommitId():
+
+  stream = os.popen(git log)
+  line = stream.readline()
+  return line.replace(commit ,).replace(\n,)
+
+def displayUsage():
+
+  print
+  print Parses the callgrind results of make percheck
+  print
+  print Usage: bin/parse_perfcheck.py [targetFileName = perfcheckResult.csv] 
[sourceDirectory = ./workdir/CppunitTest]
+  print default assumes running from core root directory
+  print
+
+if __name__ == '__main__':
+
+  #check args
+
+  if len(sys.argv)  3:
+  if len(sys.argv) == 2:
+  if sys.argv[1] == --help:
+displayUsage()
+sys.exit(1)
+  else:
+targetFileName = sys.argv[1]
+sourceDirectory = ./workdir/CppunitTest
+  elif len(sys.argv) == 1:
+  targetFileName = perfcheckResult.csv
+  sourceDirectory = ./workdir/CppunitTest
+  else:
+  displayUsage()
+  sys.exit(1)
+  else:
+  targetFileName = sys.argv[1]
+  sourceDirectory = sys.argv[2]
+
+  # check if sourceDirectorty exists
+  if not os.path.isdir(sourceDirectory):
+print sourceDirectorty %s not found - Aborting % (sourceDirectory)
+sys.exit(1)
+
+  # last commit Id
+  lastCommitId = getLastCommitId()
+
+  # needs header in csv file ?
+  needsCsvHeader = not os.path.isfile(targetFileName)
+
+  # call walker
+  globalResult = processDirectory(sourceDirectory)
+
+  print globalResult
+
+  # write result
+  fileResult = open(targetFileName,'a')
+  fileResult.write(globalResult)
+  fileResult.close()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: enhancing perfcheck - Proof of concept proposals

2014-10-28 Thread Laurent Godard

Hi Matus,

Thanks a lot for your detailled response

I'm actually in holidays with family and will be back next week; I hope 
then to be able to continue this work (but feel free to start it !)



I've added it to loperf; it's now in
http://dev-builds.libreoffice.org/callgrind_report/

So, there is no need for the load test now, I think.



Great, thanks a lot.


but I think it's a bit different with callgrind - you see everything there.
And with 100 items, you should be already able to spot quadratic complexity.



Ok then to reduce the 'big file' size and not instrument its loading
I'll do it when back. I'll rebuild a new one


Regarding output results, the approach i took was to first gather all 
the results in the csv file
Then post-processing it in a spreadsheet (say, randomly, calc) and use 
standard filters to isolate the tests



Instead something like
commit date test_name-1-dump_comment-1 ... test_name-n-dump_comment-m

commit date number_1 ... numbers for different tests
commit+1 date number_2 ...



will be restricted to 1024 columns (500 tests) but may be enough


would be better I think - you can just compare
number_1 and number_2 on the next row in the same column.
Hopefully this makes sense.



Sure it makes sense :)


The script would need to be clever enough to add new columns when needed 
somehow.
Or, another possibility is to have another script which would generate
file with the second format mentioned here from the existing csv file.



Yes, i'll have a look a this. Then we could have both formats (in case 
in needed) and this second script could also dump alerts



- set IS_PERFCHECK


this would be set all the time (not needed)
make perfcheck would just run tests under callgrind, where it makes sense



ok but i still do not catch how the beast would know if callgrind is 
running or not. how would startImplemntation and endImplementation 
behave if callgrind is not running (case of normal tests)



I am happy to hack this in, or help you with implementation - as you choose.



as said before, i won't be able to work on this until middle of next 
week, sorry


So feel free to enhance this and when joining back, i'll start on the 
evolutions you may have implemented


thanks a lot Matus

Laurent
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: enhancing perfcheck - Proof of concept proposals

2014-10-22 Thread Laurent Godard

Hi Matus

First, thanks a lot for your answer


Most of that is just loading the file - maybe we could use 'loperf' for
testing import/export and do only the rest as perfchecks? What do you think?



I instrumented the big file load for testing purpose but yes, in 
absolute, i'm also interrested in perf check of such files loading (and 
even saving)


i agree to keep the instrumentation as slow as possible, but in my 
experience, some perf problem start to appear exponentially with file 
complexity (a lot of sheets/formulas/named ranges/cell notes)


so the first idea of this big file was to gather all the potential 
problems and instrument each case




2- exploiting results
-



$ cat perfcheckResult.csv
lastCommit  test name   filedatetimedump commentcount
741c661ece19ccb4e94bb20ceb75d89a29b1b2a8sc_perf_searchobj
10/14/2014 09:54:52 testSheetFindAll - Search value 11403647297


Fun, for me Search value is more than 10x faster - Was there some fix recently?
10/22/2014 08:27:58 testSheetFindAll - Search value 766042247


i work on 2 a weeks old branch
would be great if things evolved here ;-)



Well, this is good but it's hard to parse the results quickly.
Do you think we could have date/commit in one line with all numbers?
And descriptions somewhere at the top.
So that we could compare results in one column easily (and draw graphs..)
Something like
http://dev-builds.libreoffice.org/callgrind_report/history.fods



this is what is intended to be done

the output is a tabulated separated csv file, with all the information 
on a single line (and description at top)


may be a bad email layout ?
btw, i'll double check




3- re use of existing tests for percheck





So - now that I think about it.
Maybe it would be better to stop duplicating makefiles too.


yes that would simplify the beast, providing we can start the 
instrumentation (and disable it on running normal tests)




Or - even better - we could just compile in the callgrind code all the time and 
decide when
running make, whether we want to run under valgrind --tool=callgrind or not (or 
both).
If that works. :-)
So, something like IS_PERFCHECK is always true, no duplication
and only decide whether to run under valgrind.

Does that make sense?
What do you think?



i like the approach as it will simplify the trickiest part (the nasty 
include to avoid double linking problem)


imho, it would be clearer to keep some 'make perfcheck' command but this 
would only

- set IS_PERFCHECK
- start running callgrind
- launch all the tests with clear parts identified with the 
start/endInstrumentation


maybe do i miss something as it is not far from the actual thing

feel free to give me some code pointers (remember, i'm only a poor 
scripter, always-beginner in core stuff ;) )


Thanks a lot again matus

Laurent
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


enhancing perfcheck - Proof of concept proposals

2014-10-16 Thread Laurent Godard

Hi all

First, i must warn that i have little experience in c++ development; So 
my wording may be strange and inacurate. Feel free to request for 
rewording if something is not clear


manys thanks to all the devs who helped me on this (matus, mst)

i'll present in the comming line the approach i've tested regarding make 
perfcheck


The initial work has been pointing by Matus
The idea is to use valgrind while running tests
my starting point has been https://gerrit.libreoffice.org/#/c/11296

My goal was to enhance this with in mind that make perfcheck is only 
launched on demand as it is a costly process


Here are the adressed points; I present them in the order of which i 
developped them, may be inapropriate


1- percheck tests not restricted at class level
2- exploiting results
3- re use of existing tests for percheck

I'll point the gerrit commits in each of these points
They are first shoots and may need some (a lot of) polish
at least it builds and do what expected

Any comments welcome

my code is far from being perfect
let me know if it needs something to be done before being pushed to master

Thanks again to all of the dev that helped me


Laurent

==

1- percheck tests not restricted at class level
---

The problem being at classe level is that some tests may be very long 
and hide problems on other performed tests. Time can be doubled without 
noticing it


The goal here is to be able to DUMP callgrind each time we want it

Instead of using
CALLGRIND_DUMP_STATS

one can use
CALLGRIND_DUMP_STATS_AT(message);

-- this will create a callgrind.out file at each call
-- then we can separate the different part of a test
-- note the (message) that will be used in part 2

a first approach of a big test, with 3 dumps is here
https://gerrit.libreoffice.org/#/c/11949/

2- exploiting results
-

The dumps are stored in workdir/CppunitTest/

Each dump file starting with callgrind.out contains
- the message of step 1
- the total of cycles

here is a python script that walk through workdir/CppunitTest/ and 
retreive these 2 information for each dump file

It also retreives the currently last commit

it append these results in a csv file
TODO: use this csv file to monitor or detect problems

https://gerrit.libreoffice.org/#/c/11962/

output example

$ cat perfcheckResult.csv
lastCommit  test name   filedatetimedump commentcount
741c661ece19ccb4e94bb20ceb75d89a29b1b2a8sc_perf_searchobj 
10/14/2014 09:54:52 testSheetFindAll - Search value 11403647297
741c661ece19ccb4e94bb20ceb75d89a29b1b2a8sc_perf_searchobj 
10/14/2014 09:54:53 testSheetFindAll - Search style 767867
741c661ece19ccb4e94bb20ceb75d89a29b1b2a8sc_perf_searchobj 
10/14/2014 09:52:06 Load Big File   17078422628


3- re use of existing tests for percheck


i tried this approach because monitoring perfs would lead to write 
duplicate tests


the naive question was : why not reuse existing tests that would start 
callgrind instrumentation only if we are in a perfcheck context ?


it would then be transparent for subsequentcheck and enhance perftest 
coverage


as we saw at step 1, one can start callgrind instrumentation for only 
few chosen lines


the basic idea, in an existing test, would be to write something like

startPerfInstrumentation();
  uno::Reference container::XIndexAccess  xIndex = 
xSearchable-findAll(xSearchDescr);

  endPerfInstrumentation(testSheetFindAll - Search value);

where startPerfInstrumentation and endPerfInstrumentation do nothing if 
not in a perfcheck context


see whole code example at
https://gerrit.libreoffice.org/#/c/11982/

this context is set using$(eval $(call 
gb_CppunitTest_add_defs,sc_perf_searchobj,\

-DIS_PERFCHECK \
))

see then
https://gerrit.libreoffice.org/#/c/11982/2/sc/qa/perf/perf_instrumentation.cxx,cm

the idea is to have 2 make files
- one for subsequent test
- one for perfcheck (that sets IS_PERFCHECK)

that point to the same source test but lets perf_instrumentation.cxx be 
re-build each time


globally seems to work with some tricky parts
(thanks mst for your help)
https://gerrit.libreoffice.org/#/c/11982/2/sc/qa/perf/scperfsearch.cxx,cm
i don't know if it can lead to some problems

ok, i stop here, ask me if something is not clear

--
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: sc/source

2014-10-15 Thread Laurent Godard
 sc/source/core/data/table2.cxx |   15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

New commits:
commit 91502a72c12c559442e8bf77c27a516b49c2a68d
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Thu Oct 9 14:44:27 2014 +0200

fdo#83141: also optimize ScTable::HasAttribSelection

applying same strategy than 1e721077b43de84edab2a3ed2f316ddcbec6e3ec

Change-Id: I8c226d5d66ba8371ea1baec73e72b3e50886bb4f
Reviewed-on: https://gerrit.libreoffice.org/11877
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 5e67a6a..98e5121 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1849,10 +1849,17 @@ bool ScTable::HasAttrib( SCCOL nCol1, SCROW nRow1, 
SCCOL nCol2, SCROW nRow2, sal
 
 bool ScTable::HasAttribSelection( const ScMarkData rMark, sal_uInt16 nMask ) 
const
 {
-bool bFound = false;
-for (SCCOL i=0; i=MAXCOL  !bFound; i++)
-bFound |= aCol[i].HasAttribSelection( rMark, nMask );
-return bFound;
+std::vectorsc::ColRowSpan aSpans = rMark.GetMarkedColSpans();
+
+for (size_t i = 0; i  aSpans.size(); ++i)
+{
+for (SCCOLROW j = aSpans[i].mnStart; j  aSpans[i].mnEnd; ++j)
+{
+if (aCol[j].HasAttribSelection(rMark, nMask))
+  return true;
+}
+}
+return false;
 }
 
 bool ScTable::ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gbuild

2014-10-13 Thread Laurent Godard
 solenv/gbuild/CppunitTest.mk |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b1e9163b5929f68860b56b04112fb76d303f6388
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Mon Oct 13 11:50:39 2014 +0200

enhance perfcheck failing message

add the expected number

Change-Id: Ib068288f7efbfebc2705c6084dc34a651def1986
Reviewed-on: https://gerrit.libreoffice.org/11948
Reviewed-by: Matúš Kukan matus.ku...@collabora.com
Tested-by: Matúš Kukan matus.ku...@collabora.com

diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index d79e1ce..3c5f11c 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -96,7 +96,7 @@ $(call gb_CppunitTest_get_target,%) :| 
$(gb_CppunitTest_CPPTESTDEPS)
$(call 
gb_CppunitTest_postprocess,$(gb_CppunitTest_CPPTESTCOMMAND),$@.core,$$RET)  
$@.log 21;) \
cat $@.log; 
$(SRCDIR)/solenv/bin/unittest-failed.sh Cppunit $*))) \
$(if $(PERFTEST),  VAL=$$(grep '^==.*== Collected : ' $@.log 
| sed s/==.*== Collected : //)  \
-   $(if $(filter 0,$(PERFTEST)), expr $$VAL * 101 
/ 100, test $$VAL -le $(PERFTEST) || (echo Unit test is slow! $$VAL 
instructions detected.  false))) \
+   $(if $(filter 0,$(PERFTEST)), expr $$VAL * 101 
/ 100, test $$VAL -le $(PERFTEST) || (echo Unit test is slow! $$VAL 
instructions detected (expected $(PERFTEST)).  false))) \
)
 
 define gb_CppunitTest_CppunitTest
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sc/source

2014-10-09 Thread Laurent Godard
 sc/source/core/data/compressedarray.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 430747397508f297be7ae1fa734a43ea705e9a43
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Thu Oct 9 14:26:49 2014 +0200

remove warning: ‘nIndex’ may be used uninitialized

Change-Id: I317c2f4409f556ab967e4f08caa99cffcfce26cc
Reviewed-on: https://gerrit.libreoffice.org/11876
Reviewed-by: Kohei Yoshida libreoff...@kohei.us
Tested-by: Kohei Yoshida libreoff...@kohei.us

diff --git a/sc/source/core/data/compressedarray.cxx 
b/sc/source/core/data/compressedarray.cxx
index 234d96b..ebe2822 100644
--- a/sc/source/core/data/compressedarray.cxx
+++ b/sc/source/core/data/compressedarray.cxx
@@ -241,7 +241,7 @@ template typename A, typename D 
 void ScCompressedArrayA,D::CopyFrom( const ScCompressedArrayA,D rArray, A 
nStart,
 A nEnd, long nSourceDy )
 {
-size_t nIndex;
+size_t nIndex = 0;
 A nRegionEnd;
 for (A j=nStart; j=nEnd; ++j)
 {
@@ -373,7 +373,7 @@ void ScBitMaskCompressedArrayA,D::CopyFromAnded(
 const ScBitMaskCompressedArrayA,D rArray, A nStart, A nEnd,
 const D rValueToAnd, long nSourceDy )
 {
-size_t nIndex;
+size_t nIndex = 0;
 A nRegionEnd;
 for (A j=nStart; j=nEnd; ++j)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/17/5317/3'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/17/5317/2'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/14/10214/3'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/14/10214/2'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/14/10214/1'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/91/7391/2'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/53/2053/1'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/91/7391/1'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/17/5317/4'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/17/5317/1'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/38/1738/1'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/90/7390/1'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/95/5695/2'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/90/7390/2'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/38/1738/2'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/53/2053/4'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/55/10755/4'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/72/5572/2'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/72/5572/1'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/95/5695/1'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/53/2053/5'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/55/10755/1'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/92/7392/2'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/36/1736/1'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/72/5572/3'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/54/6954/1'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/92/7392/1'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/56/4656/2'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/54/6954/2'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/96/4696/1'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/53/2053/3'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/56/4656/1'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/75/5575/1'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/55/10755/2'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/36/1736/2'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/56/4656/3'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/63/11263/2'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/38/9938/1'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/14/6414/1'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/19/6419/2'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/98/4698/2'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/98/4698/1'

2014-09-29 Thread Laurent Godard

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   3   >