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

2013-11-08 Thread Ivan Timofeev
 basctl/source/basicide/baside2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit abd333fc9ace9e559eef2c5dcb851ef9dceac553
Author: Ivan Timofeev 
Date:   Fri Nov 8 13:59:46 2013 +0400

fdo#71306: fix [Page: N] info in headers of pages printed from basic ide

Change-Id: I115503f0fca653343cfb1e0eb9dc81937ef82648
Reviewed-on: https://gerrit.libreoffice.org/6616
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/basctl/source/basicide/baside2.cxx 
b/basctl/source/basicide/baside2.cxx
index 962658f..4eb1a924 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -135,7 +135,7 @@ void lcl_PrintHeader( Printer* pPrinter, sal_uInt16 nPages, 
sal_uInt16 nCurPage,
 
 if( bOutput )
 {
-OUString aPageStr = " [" + IDE_RESSTR(RID_STR_PAGE) + " " + 
OUString::valueOf( nCurPage ) + "]";
+OUString aPageStr = " [" + IDE_RESSTR(RID_STR_PAGE) + " " + 
OUString::number( nCurPage ) + "]";
 pPrinter->DrawText( aPos, aPageStr );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-11-08 Thread Ivan Timofeev
 basctl/source/basicide/baside2.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 028b550cce4b08b33c9970baf785b6e1bedb4da2
Author: Ivan Timofeev 
Date:   Fri Nov 8 12:52:51 2013 +0400

fdo#71306: fix printing from basic ide

regression from e13a3d566ecc34a46e037aca1b2d70e58501e422

Change-Id: I0d734e112038746aa48df669d4b82b644a95c220
(cherry picked from commit 560b27613679d2a3b3ddb89c2afe481bcf2996e3)
Reviewed-on: https://gerrit.libreoffice.org/6615
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/basctl/source/basicide/baside2.cxx 
b/basctl/source/basicide/baside2.cxx
index 4eb1a924..95ae6e1 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -903,7 +903,9 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, 
sal_Int32 nPrintPage )
 sal_uInt16 nLines = aLine.getLength()/nCharspLine+1;
 for ( sal_uInt16 nLine = 0; nLine < nLines; nLine++ )
 {
-OUString aTmpLine = aLine.copy(nLine*nCharspLine, nCharspLine );
+sal_Int32 nBeginIndex = nLine*nCharspLine;
+sal_Int32 nCopyCount = std::min(nCharspLine, 
aLine.getLength()-nBeginIndex);
+OUString aTmpLine = aLine.copy(nBeginIndex, nCopyCount);
 aPos.Y() += nLineHeight;
 if ( aPos.Y() > ( aPaperSz.Height() + Print::nTopMargin ) )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-09-15 Thread Noel Power
 basctl/source/basicide/basides1.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 2c0cc6fac2437c864a90270eadfe005dfc707726
Author: Noel Power 
Date:   Thu Sep 12 21:37:42 2013 +0100

fix for fdo#69173 crasher

the layout changes for the basic IDE ( for the object browser and object
catalog ) seem flacky, I have seen since those changes have been introduced
some strange ( but random ) behaviour ( like the odd unrepeatable core ( 
maybe
related to this ) and also sometimes Modules appearing in the tree under the
wrong nodes etc. I'm no expert in the basic IDE code but this patch seems to
fix the problem.
However there is one drawback, in the core inducing scenario the tree view
( object catalog ) dissappears, this is because the patch suppresses the
problematic layout in this case ( as the layout seem not to be currently 
able
to deal with 'no-existent' (recently) deleted current window )
Probably in this scenario a fallback currentwin (instead of nil) could be 
set
this would behave better but ideally. Ultimately the layout class should
probably be modified ( possibly redesigned )

Change-Id: I9d1e23bd6fc4aae32aa78da8278c318f7051136a

diff --git a/basctl/source/basicide/basides1.cxx 
b/basctl/source/basicide/basides1.cxx
index 474e792..6779889 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -1010,7 +1010,10 @@ void Shell::SetCurWindow( BaseWindow* pNewWin, bool 
bUpdateTabBar, bool bRemembe
 }
 }
 else
+{
+SetWindow(pLayout);
 pLayout = 0;
+}
 if ( bUpdateTabBar )
 {
 sal_uLong nKey = GetWindowId( pCurWin );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-08-08 Thread Stephan Bergmann
 basctl/source/basicide/baside3.cxx |   21 +
 basctl/source/dlged/propbrw.cxx|1 -
 basctl/source/inc/baside3.hxx  |2 +-
 3 files changed, 10 insertions(+), 14 deletions(-)

New commits:
commit fda0c984458265c2925a7ed37d9f04256f82ea0a
Author: Stephan Bergmann 
Date:   Tue Aug 6 11:58:59 2013 +0200

Prevent basctl::PropBrw using basctl::Layout from within ~Layout

...as is reproducible when creating a new dialog via "Tools - Macros - 
Organize
Dialogs", adding e.g. some date/time controls to it, then closing LO.

Invalid read of size 8
 at 0x23DD58DB: 
basctl::Layout::SplittedSide::Remove(basctl::DockingWindow*) 
(/basctl/source/basicide/layout.cxx:205)
 by 0x23DD4F65: basctl::Layout::Remove(basctl::DockingWindow*) 
(/basctl/source/basicide/layout.cxx:62)
 by 0x23D847B7: basctl::DialogWindowLayout::RemovePropertyBrowser() 
(/basctl/source/basicide/baside3.cxx:1459)
 by 0x23E45AB3: basctl::PropBrw::~PropBrw() 
(/basctl/source/dlged/propbrw.cxx:202)
 by 0x23E45BA5: basctl::PropBrw::~PropBrw() 
(/basctl/source/dlged/propbrw.cxx:205)
 by 0x7E03A49: VCLXDevice::DestroyOutputDevice() 
(/toolkit/source/awt/vclxdevice.cxx:56)
 by 0x7E4655D: VCLXWindow::dispose() 
(/toolkit/source/awt/vclxwindow.cxx:956)
 by 0x7FD451C: UnoWrapper::WindowDestroyed(Window*) 
(/toolkit/source/helper/unowrapper.cxx:263)
 by 0x95EA632: Window::~Window() (/vcl/source/window/window.cxx:4365)
 by 0x23DD4EFD: basctl::Layout::~Layout() 
(/basctl/source/basicide/layout.cxx:56)
 by 0x23D89E39: basctl::DialogWindowLayout::~DialogWindowLayout() (in 
/data/lo/core/solver/unxlngx6/installation/opt/program/libbasctllo.so)
 by 0x23D89E69: basctl::DialogWindowLayout::~DialogWindowLayout() 
(/basctl/source/inc/baside3.hxx:125)
 ...
Address 0x19d17da0 is 0 bytes inside a block of size 80 free'd
 at 0x4A078DE: operator delete(void*) (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
 by 0x23DD92D5: 
__gnu_cxx::new_allocator::deallocate(basctl::Layout::SplittedSide::Item*,
 unsigned long) (/usr/include/c++/4.8.1/ext/new_allocator.h:110)
 by 0x23DD8C77: 
std::__cxx1998::_Vector_base 
>::_M_deallocate(basctl::Layout::SplittedSide::Item*, unsigned long) 
(/usr/include/c++/4.8.1/bits/stl_vector.h:174)
 by 0x23DD7F89: 
std::__cxx1998::_Vector_base >::~_Vector_base() 
(/usr/include/c++/4.8.1/bits/stl_vector.h:160)
 by 0x23DD73DC: std::__cxx1998::vector >::~vector() 
(/usr/include/c++/4.8.1/bits/stl_vector.h:416)
 by 0x23DD6A05: std::__debug::vector >::~vector() 
(/usr/include/c++/4.8.1/debug/vector:144)
 by 0x23DD6889: basctl::Layout::SplittedSide::~SplittedSide() 
(/basctl/source/basicide/layout.hxx:80)
 by 0x23DD4EF1: basctl::Layout::~Layout() 
(/basctl/source/basicide/layout.cxx:56)
 by 0x23D89E39: basctl::DialogWindowLayout::~DialogWindowLayout() (in 
/data/lo/core/solver/unxlngx6/installation/opt/program/libbasctllo.so)
 by 0x23D89E69: basctl::DialogWindowLayout::~DialogWindowLayout() 
(/basctl/source/inc/baside3.hxx:125)
 by 0x23D997F3: void 
boost::checked_delete(basctl::DialogWindowLayout*) 
(/workdir/unxlngx6/UnpackedTarball/boost/boost/checked_delete.hpp:34)
 by 0x23D99694: 
boost::scoped_ptr::~scoped_ptr() 
(/workdir/unxlngx6/UnpackedTarball/boost/boost/smart_ptr/scoped_ptr.hpp:82)
 by 0x23D9A5E7: basctl::Shell::~Shell() 
(/basctl/source/basicide/basidesh.cxx:223)
 by 0x23D9A717: basctl::Shell::~Shell() 
(/basctl/source/basicide/basidesh.cxx:248)
 by 0x6942297: SfxViewFrame::ReleaseObjectShell_Impl() 
(/sfx2/source/view/viewfrm.cxx:1089)
 by 0x6943BAB: SfxViewFrame::~SfxViewFrame() 
(/sfx2/source/view/viewfrm.cxx:1484)
 by 0x6943E09: SfxViewFrame::~SfxViewFrame() 
(/sfx2/source/view/viewfrm.cxx:1505)
 by 0x69427EC: SfxViewFrame::Close() (/sfx2/source/view/viewfrm.cxx:1144)
 by 0x6919441: SfxFrame::DoClose_Impl() (/sfx2/source/view/frame.cxx:175)
 by 0x6934542: SfxBaseController::dispose() 
(/sfx2/source/view/sfxbasecontroller.cxx:1035)
 by 0x1BC8C5B3: 
framework::Frame::setComponent(com::sun::star::uno::Reference
 const&, com::sun::star::uno::Reference 
const&) (/framework/source/services/frame.cxx:1357)
 by 0x1BBAF54B: framework::CloseDispatcher::implts_establishBackingMode() 
(/framework/source/dispatch/closedispatcher.cxx:540)
 by 0x1BBAEB15: framework::CloseDispatcher::impl_asyncCallback(void*) 
(/framework/source/dispatch/closedispatcher.cxx:391)
 by 0x1BBAE6AF: 
framework::CloseDispatcher::dispatchWithNotification(com::sun::star::util::URL 
const&, com::sun::star::uno::Sequence 
const&, 
com::sun::star::uno::Reference 
const&) (/framework/source/dispatch/closedispatcher.cxx:228)
 by 0x23A2A71D: 
framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference
 const&, rtl::OUString const&, rtl::OUString const&, int, 
com::sun::star::uno::Sequence const&) 
(/framework/source/services/dispatchhelper.cxx:142)
 by 0

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

2013-06-28 Thread Noel Power
 basctl/source/basicide/basobj2.cxx |   41 -
 1 file changed, 32 insertions(+), 9 deletions(-)

New commits:
commit 2d7dff2d677475c7e29e5340d0ebef8545aefd97
Author: Noel Power 
Date:   Thu Jun 27 13:58:48 2013 +0100

improve performance switching modules in large Libraries fdo#66148

object catalog when updated, updates ( all ) entries and was parsing
the source for every method in every module

Change-Id: Id68e3c24d597d29a86d3507a7dc20745c96dd2a2
(cherry picked from commit 61027ca6eb450fb20bfe9209ba180fe0606baeab)
Reviewed-on: https://gerrit.libreoffice.org/4598
Reviewed-by: Fridrich Strba 
Tested-by: Fridrich Strba 

diff --git a/basctl/source/basicide/basobj2.cxx 
b/basctl/source/basicide/basobj2.cxx
index 7e62558..d5e4b91 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -42,7 +42,7 @@
 #include 
 #include 
 #include 
-
+#include "basic/basmgr.hxx"
 namespace basctl
 {
 
@@ -405,13 +405,25 @@ Sequence< OUString > GetMethodNames( const 
ScriptDocument& rDocument, const OUSt
 OUString aOUSource;
 if ( rDocument.getModule( rLibName, rModName, aOUSource ) )
 {
-SbModuleRef xModule = new SbModule( rModName );
-xModule->SetSource32( aOUSource );
-sal_uInt16 nCount = xModule->GetMethods()->Count();
+BasicManager* pBasMgr = rDocument.getBasicManager();
+StarBASIC* pSb = pBasMgr ? pBasMgr->GetLib( rLibName ) : NULL;
+SbModule* pMod = pSb ? pSb->FindModule( rModName ) : NULL;
+
+SbModuleRef xModule;
+// Only reparse modules if ScriptDocument source is out of sync
+// with basic's Module
+if ( !pMod || ( pMod && pMod->GetSource() != aOUSource ) )
+{
+xModule = new SbModule( rModName );
+xModule->SetSource32( aOUSource );
+pMod = xModule;
+}
+
+sal_uInt16 nCount = pMod->GetMethods()->Count();
 sal_uInt16 nRealCount = nCount;
 for ( sal_uInt16 i = 0; i < nCount; i++ )
 {
-SbMethod* pMethod = (SbMethod*)xModule->GetMethods()->Get( i );
+SbMethod* pMethod = (SbMethod*)pMod->GetMethods()->Get( i );
 if( pMethod->IsHidden() )
 --nRealCount;
 }
@@ -420,7 +432,7 @@ Sequence< OUString > GetMethodNames( const ScriptDocument& 
rDocument, const OUSt
 sal_uInt16 iTarget = 0;
 for ( sal_uInt16 i = 0 ; i < nCount; ++i )
 {
-SbMethod* pMethod = (SbMethod*)xModule->GetMethods()->Get( i );
+SbMethod* pMethod = (SbMethod*)pMod->GetMethods()->Get( i );
 if( pMethod->IsHidden() )
 continue;
 SAL_WARN_IF( !pMethod, "basctl.basicide","Method not found! 
(NULL)" );
@@ -445,9 +457,20 @@ bool HasMethod (
 OUString aOUSource;
 if ( rDocument.hasModule( rLibName, rModName ) && rDocument.getModule( 
rLibName, rModName, aOUSource ) )
 {
-SbModuleRef xModule = new SbModule( rModName );
-xModule->SetSource32( aOUSource );
-SbxArray* pMethods = xModule->GetMethods();
+// Check if we really need to scan the source ( again )
+BasicManager* pBasMgr = rDocument.getBasicManager();
+StarBASIC* pSb = pBasMgr ? pBasMgr->GetLib( rLibName ) : NULL;
+SbModule* pMod = pSb ? pSb->FindModule( rModName ) : NULL;
+SbModuleRef xModule;
+// Only reparse modules if ScriptDocument source is out of sync
+// with basic's Module
+if ( !pMod || ( pMod && pMod->GetSource() != aOUSource ))
+{
+xModule = new SbModule( rModName );
+xModule->SetSource32( aOUSource );
+pMod = xModule;
+}
+SbxArray* pMethods = pMod->GetMethods();
 if ( pMethods )
 {
 SbMethod* pMethod = (SbMethod*)pMethods->Find( rMethName, 
SbxCLASS_METHOD );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits