[Libreoffice-commits] .: Branch 'libreoffice-3-5' - dbaccess/source

2012-09-10 Thread Libreoffice Gerrit user
 dbaccess/source/core/api/KeySet.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 613c7a22a850a890a358d39cae43e97f31f516a5
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Fri Aug 31 18:14:59 2012 +0200

fdo#53557: use metadata's idea of column count to allocate a row

m_pColumnNames contains only the columns that come straight from a table, 
not calculated columns

Change-Id: I2706790e8c1447d1c4e144bbdef773deeca3e2e8
Reviewed-on: https://gerrit.libreoffice.org/522
Reviewed-by: Michael Meeks michael.me...@suse.com
Tested-by: Michael Meeks michael.me...@suse.com
Signed-off-by: Michael Meeks michael.me...@suse.com

diff --git a/dbaccess/source/core/api/KeySet.cxx 
b/dbaccess/source/core/api/KeySet.cxx
index baed229..5b300ae 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -1434,11 +1434,12 @@ sal_Bool OKeySet::fetchRow()
 bRet = m_xDriverSet-next();
 if ( bRet )
 {
+const int cc = m_xSetMetaData-getColumnCount();
+
 ORowSetRow aKeyRow = new connectivity::ORowVector ORowSetValue 
((*m_pKeyColumnNames).size() + m_pForeignColumnNames-size());
-ORowSetRow aFullRow = new connectivity::ORowVector ORowSetValue 
(m_pColumnNames-size());
+ORowSetRow aFullRow = new connectivity::ORowVector ORowSetValue (cc);
 
 // Fetch the columns only once and in order, to satisfy restrictive 
backends such as ODBC
-const int cc = m_xSetMetaData-getColumnCount();
 connectivity::ORowVector ORowSetValue ::Vector::iterator aFRIter = 
aFullRow-get().begin();
 // Column 0 is reserved for the bookmark; unused here.
 ++aFRIter;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - dbaccess/source

2012-06-05 Thread Caolán McNamara
 dbaccess/source/core/api/KeySet.cxx |   15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 38786a76cf3dbc421635d40354e8c9ece409c6c5
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Fri Jun 1 11:42:53 2012 +0200

fdo#50372: crash when refresh of last already-known row unexpectedly fails

Instead, try to do the least unreasonable thing:
Fetch a new row
If that fails because no new row to fetch, at least we are properly 
positioned after last row. Calling code may not expect that and get confused, 
but that is the best we can do.

Change-Id: Ib7248e99ae3deee8344e9386cac2c9440e8bccd8

diff --git a/dbaccess/source/core/api/KeySet.cxx 
b/dbaccess/source/core/api/KeySet.cxx
index 74b8b17..881da40 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -1375,10 +1375,23 @@ void SAL_CALL OKeySet::refreshRow() throw(SQLException, 
RuntimeException)
 sal_Bool bOK = m_xSet-next();
 if ( !bOK )
 {
+// This row has disappeared; remove it.
 OKeySetMatrix::iterator aTemp = m_aKeyIter;
+// use *next* row
 ++m_aKeyIter;
 m_aKeyMap.erase(aTemp);
---m_rRowCount;
+
+// adjust RowCount for the row we have removed
+if (m_rRowCount  0)
+--m_rRowCount;
+else
+OSL_FAIL(m_rRowCount got out of sync: non-empty m_aKeyMap, but 
m_rRowCount = 0);
+
+if (!isAfterLast())
+{
+// it was the last row, but there may be another one to fetch
+fetchRow();
+}
 refreshRow();
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - dbaccess/source

2012-06-05 Thread Caolán McNamara
 dbaccess/source/core/api/KeySet.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 16910edcae542e8eb8a5f9b4278aceaa39262b44
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Fri Jun 1 16:40:41 2012 +0200

fdo#47520 use the already retrieved row instead of driver row

This avoids asking the driver for the same data twice.
This is particularly important for ODBC data sources, because when asking 
for (VAR)CHAR data the second time, one gets no data (and status SQL_NO_DATA) 
because of the retrieve in parts semantics of these datatypes.

Change-Id: I96f2df9927fda72ccf19f78ec5c561f5626c003f

diff --git a/dbaccess/source/core/api/KeySet.cxx 
b/dbaccess/source/core/api/KeySet.cxx
index 881da40..44c17d8 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -1271,8 +1271,7 @@ sal_Bool OKeySet::absolute_checked( sal_Int32 
row,sal_Bool i_bFetchRow )
 bNext = fetchRow();
 if ( bNext )
 {
-m_xRow.set(m_xDriverRow,UNO_QUERY_THROW);
-return m_aKeyIter != m_aKeyMap.end()  m_aKeyIter != 
m_aKeyMap.begin();
+i_bFetchRow = true;
 }
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - dbaccess/source

2012-03-20 Thread Petr Mladek
 dbaccess/source/ui/querydesign/QueryDesignView.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 73a5ef4cb245acb120f02d487ba7c3aeb40f4fad
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Thu Mar 15 11:22:32 2012 +0100

fdo#46843 look for order by clause as fifth child of select_statement

Since commit 33b9b857ea6cb5a6f731de68f58e532242c43d30 (dba34c: #i20306# 
support for window function and limit fetch first, ... added), order by is the 
fifth child. It was the fourth one before.

Signed-off-by: Petr Mladek pmla...@suse.cz

diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx 
b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index 3f500b7..c9c6092 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -2318,9 +2318,9 @@ namespace
 const ::connectivity::OSQLParseNode* pParseRoot )
 {
 SqlParseError eErrorCode = eOk;
-if (!pParseRoot-getChild(3)-getChild(4)-isLeaf())
+if (!pParseRoot-getChild(3)-getChild(ORDER_BY_CHILD_POS)-isLeaf())
 {
-::connectivity::OSQLParseNode* pNode = 
pParseRoot-getChild(3)-getChild(4)-getChild(2);
+::connectivity::OSQLParseNode* pNode = 
pParseRoot-getChild(3)-getChild(ORDER_BY_CHILD_POS)-getChild(2);
 ::connectivity::OSQLParseNode* pParamRef = NULL;
 
 OQueryController rController = 
static_castOQueryController(_pView-getController());
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - dbaccess/source

2012-02-01 Thread Jan Holesovsky
 dbaccess/source/core/api/KeySet.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit acc36a60de35cdc07e41d1838738b7603e87cf4d
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Tue Jan 31 21:32:55 2012 +0100

fdo#45453: use integers rather than booleans

for always-true and always-false tests.
Some databases have poor or no support for booleans.

Signed-off-by: Jan Holesovsky ke...@suse.cz

diff --git a/dbaccess/source/core/api/KeySet.cxx 
b/dbaccess/source/core/api/KeySet.cxx
index b41e68b..8e42b30 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -228,8 +228,8 @@ namespace
 void appendOneKeyColumnClause( const ::rtl::OUString tblName, const 
::rtl::OUString colName, ::rtl::OUStringBuffer o_buf )
 {
 static ::rtl::OUString s_sDot(RTL_CONSTASCII_USTRINGPARAM(.));
-static ::rtl::OUString s_sParam0(RTL_CONSTASCII_USTRINGPARAM( ( TRUE 
= ? AND ));
-static ::rtl::OUString s_sParam1(RTL_CONSTASCII_USTRINGPARAM( = ? OR 
TRUE = ? AND ));
+static ::rtl::OUString s_sParam0(RTL_CONSTASCII_USTRINGPARAM( ( 1 = ? 
AND ));
+static ::rtl::OUString s_sParam1(RTL_CONSTASCII_USTRINGPARAM( = ? OR 
1 = ? AND ));
 static ::rtl::OUString s_sParam2(RTL_CONSTASCII_USTRINGPARAM( IS NULL 
) ));
 o_buf.append(s_sParam0);
 o_buf.append(tblName);
@@ -247,16 +247,16 @@ void OKeySet::setOneKeyColumnParameter( sal_Int32 nPos, 
const Reference XParam
 {
 if ( _rValue.isNull() )
 {
-_xParameter-setBoolean( nPos++, false );
+_xParameter-setByte( nPos++, 0 );
 // We do the full call so that the right sqlType is passed to setNull
 setParameter( nPos++, _xParameter, _rValue, _nType, _nScale );
-_xParameter-setBoolean( nPos++, true );
+_xParameter-setByte( nPos++, 1 );
 }
 else
 {
-_xParameter-setBoolean( nPos++, true );
+_xParameter-setByte( nPos++, 1 );
 setParameter( nPos++, _xParameter, _rValue, _nType, _nScale );
-_xParameter-setBoolean( nPos++, false );
+_xParameter-setByte( nPos++, 0 );
 }
 }
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - dbaccess/source

2012-01-23 Thread Julien Nabet
 dbaccess/source/ui/browser/unodatbr.cxx |   18 --
 1 file changed, 8 insertions(+), 10 deletions(-)

New commits:
commit 4d60e1a0832dafe05b4eecee7c9607bbd2ce1b07
Author: Julien Nabet serval2...@yahoo.fr
Date:   Mon Jan 23 21:22:59 2012 +0100

Fix fdo#44040 VIEWING: Crash when page preview after f4 (data sources)

Caolán fixed iterator management which was buggy. (thank you !)

(cherry picked from commit 82a061079ae03f841713fd26c809d45621a59836)

diff --git a/dbaccess/source/ui/browser/unodatbr.cxx 
b/dbaccess/source/ui/browser/unodatbr.cxx
index 9ca1392..7567542 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -1410,24 +1410,22 @@ void SAL_CALL SbaTableQueryBrowser::disposing( const 
EventObject _rSource ) thr
 Reference XDispatch  xSource(_rSource.Source, UNO_QUERY);
 if(xSource.is())
 {
-for (  ExternalFeaturesMap::iterator aLoop = 
m_aExternalFeatures.begin();
-  aLoop != m_aExternalFeatures.end();
-  ++aLoop
-)
+ExternalFeaturesMap::iterator aLoop = m_aExternalFeatures.begin();
+ExternalFeaturesMap::iterator aEnd = m_aExternalFeatures.end();
+while (aLoop != aEnd)
 {
-if ( aLoop-second.xDispatcher.get() == xSource.get() )
+ExternalFeaturesMap::iterator aI = aLoop++;
+if ( aI-second.xDispatcher.get() == xSource.get() )
 {
-ExternalFeaturesMap::iterator aPrevious = aLoop;
---aPrevious;
+sal_uInt16 nSlot = aI-first;
 
 // remove it
-m_aExternalFeatures.erase( aLoop );
+m_aExternalFeatures.erase(aI);
 
 // maybe update the UI
-implCheckExternalSlot(aLoop-first);
+implCheckExternalSlot(nSlot);
 
 // continue, the same XDispatch may be resposible for more 
than one URL
-aLoop = aPrevious;
 }
 }
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - dbaccess/source svtools/inc svtools/source

2011-12-28 Thread Ivan Timofeev
 dbaccess/source/ui/dlg/CollectionView.cxx |2 -
 svtools/inc/svtools/fileview.hxx  |7 +--
 svtools/source/contnr/fileview.cxx|   60 +++---
 svtools/source/contnr/templwin.cxx|2 -
 4 files changed, 26 insertions(+), 45 deletions(-)

New commits:
commit 150c18ecb0d0eb0dbcef50bb1d76b7c549255104
Author: Ivan Timofeev timofeev@gmail.com
Date:   Wed Dec 28 20:00:03 2011 +0400

fdo#44204: shrink the first column in the open dialog, remove unused flags

diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx 
b/dbaccess/source/ui/dlg/CollectionView.cxx
index 23e4762..af28a0b 100644
--- a/dbaccess/source/ui/dlg/CollectionView.cxx
+++ b/dbaccess/source/ui/dlg/CollectionView.cxx
@@ -80,7 +80,7 @@ OCollectionView::OCollectionView( Window * pParent
 , m_aFTCurrentPath( this, ModuleRes( FT_EXPLORERFILE_CURRENTPATH ) )
 , m_aNewFolder( this, ModuleRes( BTN_EXPLORERFILE_NEWFOLDER ) )
 , m_aUp(this, ModuleRes( BTN_EXPLORERFILE_UP ) )
-, m_aView(  this, ModuleRes( CTRL_VIEW ) ,FILEVIEW_SHOW_TITLE )
+, m_aView(  this, ModuleRes( CTRL_VIEW ), FILEVIEW_SHOW_ONLYTITLE )
 , m_aFTName(this, ModuleRes( FT_EXPLORERFILE_FILENAME ) )
 , m_aName(  this, ModuleRes( ED_EXPLORERFILE_FILENAME ) )
 , m_aFL(this, ModuleRes( FL_1 ) )
diff --git a/svtools/inc/svtools/fileview.hxx b/svtools/inc/svtools/fileview.hxx
index d56826f..ec40c05 100644
--- a/svtools/inc/svtools/fileview.hxx
+++ b/svtools/inc/svtools/fileview.hxx
@@ -43,11 +43,8 @@
 #define FILEVIEW_ONLYFOLDER 0x0001
 #define FILEVIEW_MULTISELECTION 0x0002
 
-#define FILEVIEW_SHOW_TITLE 0x0010
-#define FILEVIEW_SHOW_SIZE  0x0020
-#define FILEVIEW_SHOW_DATE  0x0040
-#define FILEVIEW_SHOW_ALL   0x0070
-#define FILEVIEW_SHOW_NONE  0x0080
+#define FILEVIEW_SHOW_ONLYTITLE 0x0010
+#define FILEVIEW_SHOW_NONE  0x0020
 
 class ViewTabListBox_Impl;
 class SvtFileView_Impl;
diff --git a/svtools/source/contnr/fileview.cxx 
b/svtools/source/contnr/fileview.cxx
index 4f17f34..f726a09 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -722,24 +722,29 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( Window* 
pParentWin,
 mbEnableRename  ( sal_True )
 
 {
-sal_Bool bViewHeader = true;
+const bool bViewHeader = (nFlags  FILEVIEW_SHOW_NONE) == 0;
 Size aBoxSize = pParentWin-GetSizePixel();
 mpHeaderBar = new HeaderBar( pParentWin, WB_BUTTONSTYLE | WB_BOTTOMBORDER 
);
 mpHeaderBar-SetPosSizePixel( Point( 0, 0 ), 
mpHeaderBar-CalcWindowSizePixel() );
 
 HeaderBarItemBits nBits = ( HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE );
-if ((nFlags  FILEVIEW_SHOW_NONE) == FILEVIEW_SHOW_NONE)
-bViewHeader = false;
+if (nFlags  FILEVIEW_SHOW_ONLYTITLE)
+{
+long pTabs[] = { 2, 20, 600 };
+SetTabs(pTabs[0], MAP_PIXEL);
+
+mpHeaderBar-InsertItem(COLUMN_TITLE, 
String(SvtResId(STR_SVT_FILEVIEW_COLUMN_TITLE)), 600, nBits | HIB_UPARROW);
+}
 else
 {
-if (nFlags  FILEVIEW_SHOW_TITLE)
-mpHeaderBar-InsertItem(COLUMN_TITLE, 
String(SvtResId(STR_SVT_FILEVIEW_COLUMN_TITLE)), 600, nBits | HIB_UPARROW);
-if (nFlags  FILEVIEW_SHOW_ALL)
-mpHeaderBar-InsertItem(COLUMN_TYPE, 
String(SvtResId(STR_SVT_FILEVIEW_COLUMN_TYPE)), 140, nBits);
-if (nFlags  FILEVIEW_SHOW_SIZE)
-mpHeaderBar-InsertItem(COLUMN_SIZE, 
String(SvtResId(STR_SVT_FILEVIEW_COLUMN_SIZE)), 80, nBits);
-if (nFlags  FILEVIEW_SHOW_DATE)
-mpHeaderBar-InsertItem(COLUMN_DATE, 
String(SvtResId(STR_SVT_FILEVIEW_COLUMN_DATE)), 500, nBits);
+long pTabs[] = { 5, 20, 180, 320, 400, 600 };
+SetTabs(pTabs[0], MAP_PIXEL);
+SetTabJustify(2, AdjustRight); // column Size
+
+mpHeaderBar-InsertItem(COLUMN_TITLE, 
String(SvtResId(STR_SVT_FILEVIEW_COLUMN_TITLE)), 180, nBits | HIB_UPARROW);
+mpHeaderBar-InsertItem(COLUMN_TYPE, 
String(SvtResId(STR_SVT_FILEVIEW_COLUMN_TYPE)), 140, nBits);
+mpHeaderBar-InsertItem(COLUMN_SIZE, 
String(SvtResId(STR_SVT_FILEVIEW_COLUMN_SIZE)), 80, nBits);
+mpHeaderBar-InsertItem(COLUMN_DATE, 
String(SvtResId(STR_SVT_FILEVIEW_COLUMN_DATE)), 500, nBits);
 }
 
 Size aHeadSize = mpHeaderBar-GetSizePixel();
@@ -748,6 +753,8 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( Window* 
pParentWin,
 InitHeaderBar( mpHeaderBar );
 SetHighlightRange();
 SetEntryHeight( ROW_HEIGHT );
+if (nFlags  FILEVIEW_MULTISELECTION)
+SetSelectionMode( MULTIPLE_SELECTION );
 
 Show();
 if( bViewHeader )
@@ -1211,7 +1218,7 @@ SvtFileView::SvtFileView( Window* pParent, const ResId 
rResId,
 
 Control( pParent, rResId )
 {
-sal_Int8 nFlags = FILEVIEW_SHOW_ALL;
+sal_Int8 nFlags = 0;
 if ( bOnlyFolder )
 nFlags |= FILEVIEW_ONLYFOLDER;
 if ( bMultiSelection )
@@ 

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - dbaccess/source

2011-12-26 Thread Andras Timar
 dbaccess/source/ui/dlg/indexdialog.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 18296b08b1c05837b1f06f5773d95246cfd7cb68
Author: Andras Timar ati...@suse.com
Date:   Mon Dec 26 22:34:08 2011 +0100

missing icons in Index Design dialog fdo#38435

diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx 
b/dbaccess/source/ui/dlg/indexdialog.cxx
index b11ce3a..43270ac 100644
--- a/dbaccess/source/ui/dlg/indexdialog.cxx
+++ b/dbaccess/source/ui/dlg/indexdialog.cxx
@@ -882,7 +882,7 @@ DBG_NAME(DbaIndexDialog)
 {
 nN = IMG_INDEX_DLG_LC;
 }
-return ImageList( nN );
+return ImageList(ModuleRes(nN));
 }
 //--
 void DbaIndexDialog::resizeControls(const Size _rDiff)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits