[Libreoffice-commits] core.git: 21 commits - connectivity/source dbaccess/source hwpfilter/source sc/AllLangResTarget_sc.mk sc/inc sc/source sc/uiconfig sc/UIConfig_scalc.mk sfx2/source svtools/source sw/source vcl/source writerfilter/source
Caolán McNamara
caolanm at redhat.com
Thu Dec 19 03:31:42 PST 2013
connectivity/source/drivers/mork/MorkParser.cxx | 35 +++-
dbaccess/source/ui/misc/WNameMatch.cxx | 8 -
hwpfilter/source/hwpfile.cxx | 16 +-
hwpfilter/source/hwpreader.cxx | 18 --
sc/AllLangResTarget_sc.mk | 1
sc/UIConfig_scalc.mk | 1
sc/inc/sc.hrc | 2
sc/inc/scabstdlg.hxx | 3
sc/source/ui/attrdlg/scdlgfact.cxx | 19 --
sc/source/ui/attrdlg/scdlgfact.hxx | 3
sc/source/ui/dbgui/subtdlg.cxx | 25 +--
sc/source/ui/dbgui/tpsubt.cxx | 1
sc/source/ui/inc/subtdlg.hrc | 37 -----
sc/source/ui/inc/subtdlg.hxx | 5
sc/source/ui/src/subtdlg.src | 69 ---------
sc/source/ui/view/cellsh1.cxx | 6
sc/uiconfig/scalc/ui/subtotaldialog.ui | 176 ++++++++++++++++++++++++
sfx2/source/dialog/filtergrouping.cxx | 4
svtools/source/contnr/imivctl2.cxx | 12 +
sw/source/ui/index/cnttab.cxx | 9 -
vcl/source/gdi/sallayout.cxx | 3
writerfilter/source/dmapper/PropertyIds.cxx | 7
writerfilter/source/dmapper/PropertyIds.hxx | 2
23 files changed, 267 insertions(+), 195 deletions(-)
New commits:
commit 001bd53a18c3566ee92344d5f00f6b575c63f9fa
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 11:27:41 2013 +0000
CID#1038302 (unlikely) invalid iterator use
Change-Id: Iff61209eb840d5b6722b651580a77ae50d610460
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 6e0f9bf..8f5d5a1 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -1392,6 +1392,9 @@ int GenericSalLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos
if( nStart >= (int)m_GlyphItems.size() )
return 0;
+ if( pG == pGEnd )
+ return 0;
+
// calculate absolute position in pixel units
Point aRelativePos = pG->maLinearPos - maBasePoint;
commit 2f0a036745828dde5b2b63d4a59e5a6fd677e097
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 11:12:03 2013 +0000
CID#982610 inefficient iterator usage confusing coverity
Change-Id: I79142f5f1723fa2db0e729cb0dacb201e41077bc
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index 15aa3bf..8347fd4 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -3444,16 +3444,8 @@ void HwpReader::makeTable(TxtBox * hbox)
// ----------- cell ---------------- //
int j = -1, k = -1;
- for (int i = 0 ; i < static_cast<int>(tbl->cells.size()); i++)
+ for (std::list<TCell*>::iterator it = tbl->cells.begin(), aEnd = tbl->cells.end(); it != aEnd; ++it)
{
- std::list<TCell*>::iterator it = tbl->cells.begin();
-
- for( int ii = 0; it != tbl->cells.end(); ++it, ii++ )
- {
- if( ii == i )
- break;
- }
-
TCell *tcell = *it;
if( tcell->nRowIndex > j )
{
commit 47bda1cfc9f31d95ee88fd56aaa3235e60270922
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 11:11:12 2013 +0000
fix indent
Change-Id: I68aae5b6059c0e7281e45d39eb94ce247c6dae47
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index 7ed1500..15aa3bf 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -3448,10 +3448,11 @@ void HwpReader::makeTable(TxtBox * hbox)
{
std::list<TCell*>::iterator it = tbl->cells.begin();
- for( int ii = 0; it != tbl->cells.end(); ++it, ii++ ){
- if( ii == i )
- break;
- }
+ for( int ii = 0; it != tbl->cells.end(); ++it, ii++ )
+ {
+ if( ii == i )
+ break;
+ }
TCell *tcell = *it;
if( tcell->nRowIndex > j )
commit 976193c1b6d625ab8afa6efc2997ea7771304a83
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 11:10:09 2013 +0000
CID#982609 inefficient iterator usage confusing coverity
Change-Id: I9f170cc8c36fe89e596ee703231ba8abff5564c5
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index e9f0f3b..7ed1500 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -1901,16 +1901,8 @@ void HwpReader::makeTableStyle(Table *tbl)
}
// --------------- cell --------------------- //
- for (int i = 0 ; i < static_cast<int>(tbl->cells.size()); i++)
+ for (std::list<TCell*>::iterator it = tbl->cells.begin(), aEnd = tbl->cells.end(); it != aEnd; ++it)
{
- std::list<TCell*>::iterator it = tbl->cells.begin();
-
- for( int ii = 0; it != tbl->cells.end(); ++it, ii++ )
- {
- if( ii == i )
- break;
- }
-
TCell *tcell = *it;
sprintf(buf,"Table%d.%c%d",hbox->style.boxnum, 'A'+ tcell->nColumnIndex, tcell->nRowIndex +1);
padd(ascii("style:name"), sXML_CDATA, ascii( buf ));
commit 5594f633a19344e7b5043b732c5fc0c944a74eba
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 11:07:20 2013 +0000
fix indent
Change-Id: I6e531cdd2dd0657286cc369031072c28cf9c8e37
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index e752ae7..e9f0f3b 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -1905,10 +1905,11 @@ void HwpReader::makeTableStyle(Table *tbl)
{
std::list<TCell*>::iterator it = tbl->cells.begin();
- for( int ii = 0; it != tbl->cells.end(); ++it, ii++ ){
- if( ii == i )
- break;
- }
+ for( int ii = 0; it != tbl->cells.end(); ++it, ii++ )
+ {
+ if( ii == i )
+ break;
+ }
TCell *tcell = *it;
sprintf(buf,"Table%d.%c%d",hbox->style.boxnum, 'A'+ tcell->nColumnIndex, tcell->nRowIndex +1);
commit 76e02b7fbf57af81446b4449bd5bc3ed4349a923
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 11:01:30 2013 +0000
CID#982608 using invalid iterator
Change-Id: I0075323a75ea7c8af9738ab3ff9a0c9e2d1346d7
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index b6d3657..bf66ca2 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -530,7 +530,7 @@ Table *HWPFile::getTable(int index)
break;
}
- return *it;
+ return it != tables.end() ? *it : NULL;
}
void HWPFile::AddParaShape(ParaShape * pshape)
commit 8245c5fe1e06f78d2a2ea9d407dbc1b8eaa63cd7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 11:00:45 2013 +0000
CID#982607 using invalid iterator
Change-Id: Ic57140eab3c93e68a8455e5b9975154f76166473
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index 48d2f37..b6d3657 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -505,7 +505,7 @@ HeaderFooter *HWPFile::getHeaderFooter(int index)
break;
}
- return *it;
+ return it != headerfooters.end() ? *it : NULL;
}
ShowPageNum *HWPFile::getPageNumber(int index)
commit 80592d9786881e650413c4669ab1b0abb78d5f10
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 11:00:11 2013 +0000
CID#982606 using invalid iterator
Change-Id: Ic0f186bed177de1ed35072cef864e2079da48cd3
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index 1a7940d..48d2f37 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -517,7 +517,7 @@ ShowPageNum *HWPFile::getPageNumber(int index)
break;
}
- return *it;
+ return it != pagenumbers.end() ? *it : NULL;
}
commit 8070d5666177ee2262b54247e5d164128d606c3b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 10:59:37 2013 +0000
CID#982605 using invalid iterator
Change-Id: Ia2413a7040124b0c27ca7a3dbaaa5f222395aba8
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index 04c72cb..1a7940d 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -455,7 +455,7 @@ ParaShape *HWPFile::getParaShape(int index)
break;
}
- return *it;
+ return it != pslist.end() ? *it : NULL;
}
commit f21ed26fc57251dacfcd9b0518f24e539aa1ce26
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 10:59:08 2013 +0000
CID#982604 using invalid iterator
Change-Id: Ic62e84d256ab710c33d51c98750730064388af51
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index 6d496a2..04c72cb 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -481,7 +481,7 @@ FBoxStyle *HWPFile::getFBoxStyle(int index)
break;
}
- return *it;
+ return it != fbslist.end() ? *it : 0;
}
DateCode *HWPFile::getDateCode(int index)
commit 2e8c0b42cd54c60e14a5b037f1f6e508f14c4cb3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 10:58:30 2013 +0000
CID#982603 using invalid iterator
Change-Id: Iab80b282942dca468c314c5742cab62cb9920eb7
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index 2fe5220..6d496a2 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -468,7 +468,7 @@ CharShape *HWPFile::getCharShape(int index)
break;
}
- return *it;
+ return it != cslist.end() ? *it : 0;
}
commit 70cb503206860eefde1efdcd0e3e8aa382ed381e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 10:57:54 2013 +0000
CID#982602 using invalid iterator
Change-Id: I20d61539900626ebd5e8271e0db5ea3c22cf381e
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index b1bf470..2fe5220 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -399,7 +399,7 @@ HyperText *HWPFile::GetHyperText()
}
currenthyper++;
- return *it;
+ return it != hyperlist.end() ? *it : NULL;
}
EmPicture *HWPFile::GetEmPicture(Picture * pic)
commit 9398d4256b9886a849654cbb4f3ec960ceeb441d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 10:40:36 2013 +0000
CID#982601 using invalid iterator
Change-Id: Id5813c4353828db76f03ea885247a08d92226088
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index 0082693..b1bf470 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -493,7 +493,7 @@ DateCode *HWPFile::getDateCode(int index)
break;
}
- return *it;
+ return it != datecodes.end() ? *it : NULL;
}
HeaderFooter *HWPFile::getHeaderFooter(int index)
commit ec79f9777676dc331976719c27702ca4a535ea1d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 10:38:15 2013 +0000
CID#736013 unlikely invalid iterator use
Change-Id: I78928d4eee28adbb06b4087c51a4b384ca4e43f8
diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx
index 79221d2..958b064 100644
--- a/dbaccess/source/ui/misc/WNameMatch.cxx
+++ b/dbaccess/source/ui/misc/WNameMatch.cxx
@@ -161,7 +161,13 @@ sal_Bool OWizNameMatching::LeavePage()
m_pParent->m_vColumnPos[nPos].first = ++nParamPos;
m_pParent->m_vColumnPos[nPos].second = ::std::distance(pDestColumns->begin(),aDestIter) + 1;
sal_Bool bNotConvert = sal_True;
- TOTypeInfoSP pTypeInfo = m_pParent->convertType((*aDestIter)->second->getSpecialTypeInfo(),bNotConvert);
+
+ TOTypeInfoSP pTypeInfo;
+
+ assert(aDestIter != aDestEnd);
+ if (aDestIter != aDestEnd)
+ pTypeInfo = m_pParent->convertType((*aDestIter)->second->getSpecialTypeInfo(),bNotConvert);
+
sal_Int32 nType = ::com::sun::star::sdbc::DataType::VARCHAR;
if ( pTypeInfo.get() )
nType = pTypeInfo->nType;
commit 50d381109dd04d898f79d53970e86bd6e4e071d6
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 10:33:22 2013 +0000
CID#736017 (unlikely) invalid iterator use
Change-Id: Ibc097bfbb5cbfa221aa20cea0eba4d168b17a95f
diff --git a/svtools/source/contnr/imivctl2.cxx b/svtools/source/contnr/imivctl2.cxx
index 2da626e..1c5426e 100644
--- a/svtools/source/contnr/imivctl2.cxx
+++ b/svtools/source/contnr/imivctl2.cxx
@@ -129,7 +129,11 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(sal_uInt16 nCol, sal_uInt16 nT
if( bSimple )
{
SvxIconChoiceCtrlEntryPtrVec::const_iterator it = std::find( rList.begin(), rList.end(), pCurEntry );
- DBG_ASSERT( it != rList.end(), "Entry not in Col-List" );
+
+ assert(it != rList.end()); //Entry not in Col-List
+ if (it == rList.end())
+ return 0;
+
if( bDown )
{
while( ++it != rList.end() )
commit 1aef38545edfd02a7a5fc38285cab5f20010e4b0
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 10:32:22 2013 +0000
CID#736018 (unlikely) invalid iterator use
Change-Id: I56899cfa1010f547c2793b5248dc91a3ceb4cdb4
diff --git a/svtools/source/contnr/imivctl2.cxx b/svtools/source/contnr/imivctl2.cxx
index 508e57f..2da626e 100644
--- a/svtools/source/contnr/imivctl2.cxx
+++ b/svtools/source/contnr/imivctl2.cxx
@@ -204,7 +204,11 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(sal_uInt16 nRow, sal_uInt16 nL
if( bSimple )
{
SvxIconChoiceCtrlEntryPtrVec::const_iterator it = std::find( rList.begin(), rList.end(), pCurEntry );
- DBG_ASSERT( it != rList.end(), "Entry not in Row-List" );
+
+ assert(it != rList.end()); //Entry not in Row-List
+ if (it == rList.end())
+ return 0;
+
if( bRight )
{
while( ++it != rList.end() )
commit 5a3cbd3b7ad7b99afef920338b3c42a3867b0412
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 10:30:29 2013 +0000
CID#736021 (unlikely) invalid iterator use
Change-Id: Ic23ccd99a573765ba434fd2fb7bbfe1d3491fcd3
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 28a10b7..5410ab4 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -3090,12 +3090,15 @@ void SwTokenWindow::RemoveControl(SwTOXButton* pDel, sal_Bool bInternalCall )
ctrl_iterator it = std::find(aControlList.begin(), aControlList.end(), pDel);
- OSL_ENSURE(it != aControlList.end(), "Control does not exist!");
+ assert(it != aControlList.end()); //Control does not exist!
+ if (it == aControlList.end())
+ return;
// the two neighbours of the box must be merged
// the properties of the right one will be lost
- OSL_ENSURE(it != aControlList.begin() && it != aControlList.end() - 1,
- "Button at first or last position?");
+ assert(it != aControlList.begin() && it != aControlList.end() - 1); //Button at first or last position?
+ if (it == aControlList.begin() || it == aControlList.end() - 1)
+ return;
ctrl_iterator itLeft = it, itRight = it;
--itLeft;
commit bea15d037b89f017f203aa48ff2ae102ea09cb0c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 10:23:40 2013 +0000
CID#736937 Not restoring ostream format
Change-Id: I07b1d90258647453e498b574bc38c78872041c2d
diff --git a/connectivity/source/drivers/mork/MorkParser.cxx b/connectivity/source/drivers/mork/MorkParser.cxx
index ba1e95b..986d4fa 100644
--- a/connectivity/source/drivers/mork/MorkParser.cxx
+++ b/connectivity/source/drivers/mork/MorkParser.cxx
@@ -32,6 +32,7 @@
*/
#include "MorkParser.hxx"
+#include <boost/io/ios_state.hpp>
#include <stdlib.h>
#include <sstream>
#include <string>
@@ -601,6 +602,11 @@ std::string &MorkParser::getColumn( int oid )
void MorkParser::retrieveLists(std::set<std::string>& lists)
{
+#ifdef VERBOSE
+ boost::io::ios_all_saver ias(std::cout);
+ std::cout << std::hex << std::uppercase;
+#endif
+
MorkTableMap* tables = getTables(defaultScope_);
if (!tables) return;
for (MorkTableMap::iterator TableIter = tables->begin();
@@ -609,7 +615,7 @@ void MorkParser::retrieveLists(std::set<std::string>& lists)
#ifdef VERBOSE
std::cout << "\t Table:"
<< ( ( int ) TableIter->first < 0 ? "-" : " " )
- << std::hex << std::uppercase << TableIter->first << std::endl;
+ << TableIter->first << std::endl;
#endif
MorkRowMap* rows = getRows( defaultListScope_, &TableIter->second );
if (!rows) return;
@@ -619,7 +625,7 @@ void MorkParser::retrieveLists(std::set<std::string>& lists)
#ifdef VERBOSE
std::cout << "\t\t\t Row Id:"
<< ( ( int ) RowIter->first < 0 ? "-" : " ")
- << std::hex << std::uppercase << RowIter->first << std::endl;
+ << RowIter->first << std::endl;
std::cout << "\t\t\t\t Cells:\r\n";
#endif
// Get cells
@@ -638,6 +644,11 @@ void MorkParser::retrieveLists(std::set<std::string>& lists)
void MorkParser::getRecordKeysForListTable(std::string& listName, std::set<int>& records)
{
+#ifdef VERBOSE
+ boost::io::ios_all_saver ias(std::cout);
+ std::cout << std::hex << std::uppercase;
+#endif
+
MorkTableMap* tables = getTables(defaultScope_);
if (!tables) return;
for (MorkTableMap::iterator TableIter = tables->begin();
@@ -646,7 +657,7 @@ void MorkParser::getRecordKeysForListTable(std::string& listName, std::set<int>&
#ifdef VERBOSE
std::cout << "\t Table:"
<< ( ( int ) TableIter->first < 0 ? "-" : " " )
- << std::hex << std::uppercase << TableIter->first << std::endl;
+ << TableIter->first << std::endl;
#endif
MorkRowMap* rows = getRows( 0x81, &TableIter->second );
if (!rows) return;
@@ -656,7 +667,7 @@ void MorkParser::getRecordKeysForListTable(std::string& listName, std::set<int>&
#ifdef VERBOSE
std::cout << "\t\t\t Row Id:"
<< ( ( int ) RowIter->first < 0 ? "-" : " ")
- << std::hex << std::uppercase << RowIter->first << std::endl;
+ << RowIter->first << std::endl;
std::cout << "\t\t\t\t Cells:\r\n";
#endif
// Get cells
@@ -686,6 +697,9 @@ void MorkParser::getRecordKeysForListTable(std::string& listName, std::set<int>&
void MorkParser::dump()
{
+ boost::io::ios_all_saver ias(std::cout);
+ std::cout << std::hex << std::uppercase;
+
std::cout << "Column Dict:\r\n";
std::cout << "=============================================\r\n\r\n";
@@ -693,7 +707,7 @@ void MorkParser::dump()
for ( MorkDict::iterator iter = columns_.begin();
iter != columns_.end(); ++iter )
{
- std::cout << std::hex << std::uppercase << iter->first
+ std::cout << iter->first
<< " : "
<< iter->second
<< std::endl;
@@ -710,7 +724,7 @@ void MorkParser::dump()
continue;
}
- std::cout << std::hex << std::uppercase << iter->first
+ std::cout << iter->first
<< " : "
<< iter->second
<< "\r\n";
@@ -724,21 +738,19 @@ void MorkParser::dump()
for ( TableScopeMap::iterator iter = mork_.begin();
iter != mork_.end(); ++iter )
{
- std::cout << "\r\n Scope:" << std::hex << std::uppercase
- << iter->first << std::endl;
+ std::cout << "\r\n Scope:" << iter->first << std::endl;
for ( MorkTableMap::iterator TableIter = iter->second.begin();
TableIter != iter->second.end(); ++TableIter )
{
std::cout << "\t Table:"
<< ( ( int ) TableIter->first < 0 ? "-" : " " )
- << std::hex << std::uppercase << TableIter->first << std::endl;
+ << TableIter->first << std::endl;
for (RowScopeMap::iterator RowScopeIter = TableIter->second.begin();
RowScopeIter != TableIter->second.end(); ++RowScopeIter )
{
std::cout << "\t\t RowScope:"
- << std::hex << std::uppercase
<< RowScopeIter->first << std::endl;
for (MorkRowMap::iterator RowIter = RowScopeIter->second.begin();
@@ -746,7 +758,6 @@ void MorkParser::dump()
{
std::cout << "\t\t\t Row Id:"
<< ((int) RowIter->first < 0 ? "-" : " ")
- << std::hex << std::uppercase
<< RowIter->first << std::endl;
std::cout << "\t\t\t\t Cells:" << std::endl;
@@ -755,10 +766,8 @@ void MorkParser::dump()
{
// Write ids
std::cout << "\t\t\t\t\t"
- << std::hex << std::uppercase
<< CellsIter->first
<< " : "
- << std::hex << std::uppercase
<< CellsIter->second
<< " => ";
commit 765f3063982f17c5feacd5694dfee5b57ae5663a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 10:10:09 2013 +0000
CID#705119 (unlikely) invalid iterator
Change-Id: I6b6c99893f18deb1686fca9094037e2fada1b302
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx
index 8916ff8..a0c9dc4 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -45,7 +45,7 @@ PropertyNameSupplier::~PropertyNameSupplier()
}
-const OUString& PropertyNameSupplier::GetName( PropertyIds eId ) const
+OUString PropertyNameSupplier::GetName( PropertyIds eId ) const
{
PropertyNameMap_t::iterator aIt = m_pImpl->aNameMap.find(eId);
if(aIt == m_pImpl->aNameMap.end())
@@ -364,6 +364,11 @@ const OUString& PropertyNameSupplier::GetName( PropertyIds eId ) const
if(aInsertIt.second)
aIt = aInsertIt.first;
}
+
+ assert(aIt != m_pImpl->aNameMap.end());
+ if (aIt == m_pImpl->aNameMap.end())
+ return OUString();
+
return aIt->second;
}
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx
index 8f1fa11..e9ad035 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -337,7 +337,7 @@ class PropertyNameSupplier
public:
PropertyNameSupplier();
~PropertyNameSupplier();
- const OUString& GetName( PropertyIds eId ) const;
+ OUString GetName( PropertyIds eId ) const;
static PropertyNameSupplier& GetPropertyNameSupplier();
};
commit cff891fc44adcca745bcaa9ae95483bd63aa05ae
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 10:06:35 2013 +0000
CID#705114 (unlikely) invalid iterator
Change-Id: Ic6918da552be4905c35c5353bfb97b801e7d493c
diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx
index 402984d..2ef1cd5 100644
--- a/sfx2/source/dialog/filtergrouping.cxx
+++ b/sfx2/source/dialog/filtergrouping.cxx
@@ -659,7 +659,9 @@ namespace sfx2
aCurrentServiceName = aServiceName;
}
- DBG_ASSERT( aCurrentGroup != _rAllFilters.end(), "sfx2::lcl_GroupAndClassify: invalid current group!" );
+ assert(aCurrentGroup != _rAllFilters.end()); //invalid current group!
+ if (aCurrentGroup == _rAllFilters.end())
+ aCurrentGroup == _rAllFilters.begin();
// ===========================================================
// check if the filter is part of a global group
commit 6f754f4bd7223155591cfa9df05973db5116be81
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 19 08:55:38 2013 +0000
convert subtotals dialog to .ui
Change-Id: Icab4e598c5355a1e971fdaa5a0a4d0d72c703021
diff --git a/sc/AllLangResTarget_sc.mk b/sc/AllLangResTarget_sc.mk
index abeb023..e2ddb93 100644
--- a/sc/AllLangResTarget_sc.mk
+++ b/sc/AllLangResTarget_sc.mk
@@ -43,7 +43,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\
sc/source/ui/src/textdlgs.src \
sc/source/ui/src/sc.src \
sc/source/ui/src/pseudo.src \
- sc/source/ui/src/subtdlg.src \
sc/source/ui/src/hdrcont.src \
sc/source/ui/src/scerrors.src \
sc/source/ui/src/simpref.src \
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index fb8b696..8e1cb13 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -132,6 +132,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/sortkey \
sc/uiconfig/scalc/ui/sortoptionspage \
sc/uiconfig/scalc/ui/sortwarning \
+ sc/uiconfig/scalc/ui/subtotaldialog \
sc/uiconfig/scalc/ui/subtotaloptionspage \
sc/uiconfig/scalc/ui/subtotalgrppage \
sc/uiconfig/scalc/ui/statisticsinfopage \
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index a1de716..dafcf69 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1004,7 +1004,7 @@
#define RID_SCDLG_NAMES (SC_DIALOGS_START + 22)
#define RID_SCDLG_DBNAMES (SC_DIALOGS_START + 23)
#define RID_SCDLG_SOLVER (SC_DIALOGS_START + 26)
-#define RID_SCDLG_SUBTOTALS (SC_DIALOGS_START + 27)
+
#define RID_SCPAGE_SUBT_OPTIONS (SC_DIALOGS_START + 29)
#define RID_SCPAGE_USERLISTS (SC_DIALOGS_START + 31)
#define RID_SCDLG_PIVOTFILTER (SC_DIALOGS_START + 33)
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index cdd08eb..8414618 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -492,8 +492,7 @@ public:
int nId) = 0;
virtual SfxAbstractTabDialog * CreateScSubTotalDlg( Window* pParent,
- const SfxItemSet* pArgSet,
- int nId) = 0;
+ const SfxItemSet* pArgSet ) = 0;
virtual SfxAbstractTabDialog * CreateScCharDlg( Window* pParent, const SfxItemSet* pAttr,
const SfxObjectShell* pDocShell, int nId ) = 0;
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index c779526..cf31147 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -1157,23 +1157,10 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScStyleDlg( Window*
return 0;
}
-SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSubTotalDlg( Window* pParent,
- const SfxItemSet* pArgSet,
- int nId)
+SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSubTotalDlg(Window* pParent, const SfxItemSet* pArgSet)
{
- SfxTabDialog* pDlg=NULL;
- switch ( nId )
- {
- case RID_SCDLG_SUBTOTALS :
- pDlg = new ScSubTotalDlg( pParent, pArgSet );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new ScAbstractTabDialog_Impl( pDlg );
- return 0;
+ SfxTabDialog* pDlg = new ScSubTotalDlg( pParent, pArgSet );
+ return new ScAbstractTabDialog_Impl( pDlg );
}
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScCharDlg( Window* pParent, const SfxItemSet* pAttr,
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 07cc577..55b8ab4 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -560,8 +560,7 @@ public:
int nId);
virtual SfxAbstractTabDialog * CreateScSubTotalDlg( Window* pParent,
- const SfxItemSet* pArgSet,
- int nId);
+ const SfxItemSet* pArgSet );
virtual SfxAbstractTabDialog * CreateScCharDlg( Window* pParent, const SfxItemSet* pAttr,
const SfxObjectShell* pDocShell, int nId );
diff --git a/sc/source/ui/dbgui/subtdlg.cxx b/sc/source/ui/dbgui/subtdlg.cxx
index 6be149e..fd65451 100644
--- a/sc/source/ui/dbgui/subtdlg.cxx
+++ b/sc/source/ui/dbgui/subtdlg.cxx
@@ -25,31 +25,28 @@
#include "tpsubt.hxx"
#include "scresid.hxx"
#include "subtdlg.hxx"
-#include "subtdlg.hrc"
//==================================================================
-ScSubTotalDlg::ScSubTotalDlg( Window* pParent,
- const SfxItemSet* pArgSet ) :
- SfxTabDialog( pParent,
- ScResId( RID_SCDLG_SUBTOTALS ),
- pArgSet ),
- aBtnRemove ( m_pActionArea, ScResId( BTN_REMOVE ) )
+ScSubTotalDlg::ScSubTotalDlg(Window* pParent, const SfxItemSet* pArgSet)
+ : SfxTabDialog(pParent, "SubTotalDialog",
+ "modules/scalc/ui/subtotaldialog.ui", pArgSet)
{
- AddTabPage( PAGE_GROUP1, ScTpSubTotalGroup1::Create, 0 );
- AddTabPage( PAGE_GROUP2, ScTpSubTotalGroup2::Create, 0 );
- AddTabPage( PAGE_GROUP3, ScTpSubTotalGroup3::Create, 0 );
- AddTabPage( PAGE_OPTIONS, ScTpSubTotalOptions::Create, 0 );
- aBtnRemove.SetClickHdl( LINK( this, ScSubTotalDlg, RemoveHdl ) );
- FreeResource();
+ get(m_pBtnRemove, "remove");
+
+ AddTabPage("1stgroup", ScTpSubTotalGroup1::Create, 0);
+ AddTabPage("2ndgroup", ScTpSubTotalGroup2::Create, 0);
+ AddTabPage("3rdgroup", ScTpSubTotalGroup3::Create, 0);
+ AddTabPage("options", ScTpSubTotalOptions::Create, 0);
+ m_pBtnRemove->SetClickHdl( LINK( this, ScSubTotalDlg, RemoveHdl ) );
}
//------------------------------------------------------------------------
IMPL_LINK_INLINE_START( ScSubTotalDlg, RemoveHdl, PushButton *, pBtn )
{
- if ( pBtn == &aBtnRemove )
+ if (pBtn == m_pBtnRemove)
{
EndDialog( SCRET_REMOVE );
}
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index 28fb52a..7f777a9 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -29,7 +29,6 @@
#include "sc.hrc"
#include "subtdlg.hxx"
-#include "subtdlg.hrc"
#include "tpsubt.hxx"
//========================================================================
diff --git a/sc/source/ui/inc/subtdlg.hrc b/sc/source/ui/inc/subtdlg.hrc
deleted file mode 100644
index a5736cc..0000000
--- a/sc/source/ui/inc/subtdlg.hrc
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "sc.hrc"
-
-// TabDialog
-#define BTN_REMOVE 1
-#define PAGE_GROUP1 2
-#define PAGE_GROUP2 3
-#define PAGE_GROUP3 4
-#define PAGE_OPTIONS 5
-
-// Groups TabPages
-#define FT_GROUP 10
-#define LB_GROUP 11
-#define FT_COLUMNS 12
-#define WND_COLUMNS 13
-#define LB_FUNCTIONS 14
-#define FT_FUNCTIONS 15
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/subtdlg.hxx b/sc/source/ui/inc/subtdlg.hxx
index 1124197..1a387c8 100644
--- a/sc/source/ui/inc/subtdlg.hxx
+++ b/sc/source/ui/inc/subtdlg.hxx
@@ -29,10 +29,9 @@
class ScSubTotalDlg : public SfxTabDialog
{
public:
- ScSubTotalDlg( Window* pParent,
- const SfxItemSet* pArgSet );
+ ScSubTotalDlg(Window* pParent, const SfxItemSet* pArgSet);
private:
- PushButton aBtnRemove;
+ PushButton* m_pBtnRemove;
DECL_LINK( RemoveHdl, PushButton * );
};
diff --git a/sc/source/ui/src/subtdlg.src b/sc/source/ui/src/subtdlg.src
deleted file mode 100644
index 22769088..0000000
--- a/sc/source/ui/src/subtdlg.src
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "subtdlg.hrc"
-
-TabDialog RID_SCDLG_SUBTOTALS
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 294 , 176 ) ;
- Text [ en-US ] = "Subtotals" ;
- Moveable = TRUE ;
- Closeable = FALSE ;
- TabControl 1
- {
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 3 , 3 ) ;
- Size = MAP_APPFONT ( 240 , 150 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = PAGE_GROUP1 ;
- Text [ en-US ] = "1st Group" ;
- };
- PageItem
- {
- Identifier = PAGE_GROUP2 ;
- Text [ en-US ] = "2nd Group" ;
- };
- PageItem
- {
- Identifier = PAGE_GROUP3 ;
- Text [ en-US ] = "3rd Group" ;
- };
- PageItem
- {
- Identifier = PAGE_OPTIONS ;
- Text [ en-US ] = "Options" ;
- };
- };
- };
- PushButton BTN_REMOVE
- {
- Pos = MAP_APPFONT ( 143 , 160 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Text [ en-US ] = "~Delete" ;
- TabStop = TRUE ;
- };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 659307c..2f64ea6 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2729,10 +2729,10 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq)
aArgSet.Put( ScSubTotalItem( SCITEM_SUBTDATA, GetViewData(), &aSubTotalParam ) );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
+ assert(pFact); //"ScAbstractFactory create fail
- pDlg = pFact->CreateScSubTotalDlg( pTabViewShell->GetDialogParent(), &aArgSet, RID_SCDLG_SUBTOTALS );
- OSL_ENSURE(pDlg, "Dialog create fail!");
+ pDlg = pFact->CreateScSubTotalDlg(pTabViewShell->GetDialogParent(), &aArgSet);
+ assert(pDlg); // "Dialog create fail
pDlg->SetCurPageId(1);
short bResult = pDlg->Execute();
diff --git a/sc/uiconfig/scalc/ui/subtotaldialog.ui b/sc/uiconfig/scalc/ui/subtotaldialog.ui
new file mode 100644
index 0000000..c878a40
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/subtotaldialog.ui
@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="SubTotalDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Subtotals</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="reset">
+ <property name="label">gtk-revert-to-saved</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="remove">
+ <property name="label">gtk-remove</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkNotebook" id="tabcontrol">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="1stgroup">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">1st Group</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="2ndgroup">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">2nd Group</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="3rdgroup">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">3rd Group</property>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="options">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Options</property>
+ </object>
+ <packing>
+ <property name="position">3</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">ok</action-widget>
+ <action-widget response="0">cancel</action-widget>
+ <action-widget response="0">help</action-widget>
+ <action-widget response="0">reset</action-widget>
+ <action-widget response="0">remove</action-widget>
+ </action-widgets>
+ </object>
+</interface>
More information about the Libreoffice-commits
mailing list