[libreoffice/f16] fdo#42771 fdo#44813 fdo#43399 fdo#40261
Michael Stahl
mstahl at fedoraproject.org
Tue Feb 14 16:32:56 UTC 2012
commit 75f7ec16da4db65307ed19ff4d96afc242f64fea
Author: Michael Stahl <mstahl at redhat.com>
Date: Tue Feb 14 17:31:57 2012 +0100
fdo#42771 fdo#44813 fdo#43399 fdo#40261
- Resolves: fdo#42771 Fix crash when loading an invalid .fodt
- Resolves: fdo#44813 make the refresh query filter NULL-safe
- Resolves: fdo#43399 hidden radio button should also gets unset
- Resolves: fdo#40261 Fix crash in XML Form Document
...1-Fix-crash-when-loading-an-invalid-.fodt.patch | 45 +++
...idden-radio-button-should-also-gets-unset.patch | 45 +++
...on-t-replace-NULLs-given-by-the-database-.patch | 106 ++++++
...-fdo-40261-Fix-crash-in-XML-Form-Document.patch | 389 ++++++++++++++++++++
...3-make-the-refresh-query-filter-NULL-safe.patch | 159 ++++++++
...-crash-correct-buffer-length-allocation-f.patch | 29 ++
libreoffice.spec | 16 +
7 files changed, 789 insertions(+), 0 deletions(-)
---
diff --git a/0001-fdo-42771-Fix-crash-when-loading-an-invalid-.fodt.patch b/0001-fdo-42771-Fix-crash-when-loading-an-invalid-.fodt.patch
new file mode 100644
index 0000000..443f08a
--- /dev/null
+++ b/0001-fdo-42771-Fix-crash-when-loading-an-invalid-.fodt.patch
@@ -0,0 +1,45 @@
+From 15fe1596b265aff57264145c0e69d36607cc15a5 Mon Sep 17 00:00:00 2001
+From: Jan Holesovsky <kendy at suse.cz>
+Date: Fri, 10 Feb 2012 17:54:03 +0100
+Subject: [PATCH 1/2] fdo#42771: Fix crash when loading an invalid .fodt.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+createTextCursorByRange() likes to throw runtime exception, even though it
+just means 'we were unable to create the cursor'.
+
+Signed-off-by: Michael Meeks <michael.meeks at suse.com>
+Signed-off-by: Caolán McNamara <caolanm at redhat.com>
+---
+ xmloff/source/text/txtparai.cxx | 14 ++++++++++----
+ 1 files changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx
+index 3a73309..fb775a7 100644
+--- a/xmloff/source/text/txtparai.cxx
++++ b/xmloff/source/text/txtparai.cxx
+@@ -2034,10 +2034,16 @@ XMLParaContext::~XMLParaContext()
+ xTxtImport->InsertControlCharacter( ControlCharacter::APPEND_PARAGRAPH );
+
+ // create a cursor that select the whole last paragraph
+- Reference < XTextCursor > xAttrCursor(
+- xTxtImport->GetText()->createTextCursorByRange( xStart ));
+- if( !xAttrCursor.is() )
+- return; // Robust (defect file)
++ Reference < XTextCursor > xAttrCursor;
++ try {
++ xAttrCursor = xTxtImport->GetText()->createTextCursorByRange( xStart );
++ if( !xAttrCursor.is() )
++ return; // Robust (defect file)
++ } catch (uno::Exception &) {
++ // createTextCursorByRange() likes to throw runtime exception, even
++ // though it just means 'we were unable to create the cursor'
++ return;
++ }
+ xAttrCursor->gotoRange( xEnd, sal_True );
+
+ // xml:id for RDF metadata
+--
+1.7.7.6
+
diff --git a/0001-fdo-43399-hidden-radio-button-should-also-gets-unset.patch b/0001-fdo-43399-hidden-radio-button-should-also-gets-unset.patch
new file mode 100644
index 0000000..ce182ff
--- /dev/null
+++ b/0001-fdo-43399-hidden-radio-button-should-also-gets-unset.patch
@@ -0,0 +1,45 @@
+From e5bbb64626106bdfceea47b7b7c580172d5ae420 Mon Sep 17 00:00:00 2001
+From: Lionel Elie Mamane <lionel at mamane.lu>
+Date: Mon, 13 Feb 2012 17:36:23 +0100
+Subject: [PATCH 1/2] fdo#43399 hidden radio button should also gets unset
+
+Signed-off-by: Michael Meeks <michael.meeks at suse.com>
+---
+ extensions/source/abpilot/typeselectionpage.cxx | 12 +++++-------
+ 1 files changed, 5 insertions(+), 7 deletions(-)
+
+diff --git a/extensions/source/abpilot/typeselectionpage.cxx b/extensions/source/abpilot/typeselectionpage.cxx
+index f78878f..020e3a0 100644
+--- a/extensions/source/abpilot/typeselectionpage.cxx
++++ b/extensions/source/abpilot/typeselectionpage.cxx
+@@ -112,9 +112,13 @@ namespace abp
+ m_aAllTypes.push_back( ButtonItem( &m_aOE, AST_OE, bWithMozilla && !bUnx ) );
+ m_aAllTypes.push_back( ButtonItem( &m_aOther, AST_OTHER, true ) );
+
+- bool bFirstVisible = true;
+ Link aTypeSelectionHandler = LINK(this, TypeSelectionPage, OnTypeSelected );
+ const Size aSpacing( LogicToPixel( Size( 0, 3 ), MAP_APPFONT ) );
++ if ( ! m_aAllTypes.empty() )
++ {
++ ButtonItem aItem = m_aAllTypes[0];
++ aItem.m_pItem->SetStyle( aItem.m_pItem->GetStyle() | WB_GROUP );
++ }
+ for ( ::std::vector< ButtonItem >::const_iterator loop = m_aAllTypes.begin();
+ loop != m_aAllTypes.end(); ++loop )
+ {
+@@ -127,12 +131,6 @@ namespace abp
+ aTopLeft.Y() += aItemSize.Height() + aSpacing.Height();
+ aItem.m_pItem->SetClickHdl( aTypeSelectionHandler );
+ aItem.m_pItem->Show();
+-
+- if ( bFirstVisible )
+- {
+- aItem.m_pItem->SetStyle( aItem.m_pItem->GetStyle() | WB_GROUP );
+- bFirstVisible = false;
+- }
+ }
+ }
+ }
+--
+1.7.7.6
+
diff --git a/0001-fdo-44813-don-t-replace-NULLs-given-by-the-database-.patch b/0001-fdo-44813-don-t-replace-NULLs-given-by-the-database-.patch
new file mode 100644
index 0000000..c51d783
--- /dev/null
+++ b/0001-fdo-44813-don-t-replace-NULLs-given-by-the-database-.patch
@@ -0,0 +1,106 @@
+From 5885bf0a40b7e30d197216af5ba80568c36009cb Mon Sep 17 00:00:00 2001
+From: Lionel Elie Mamane <lionel at mamane.lu>
+Date: Mon, 16 Jan 2012 19:38:01 +0100
+Subject: [PATCH 1/2] fdo#44813: don't replace NULLs given by the database by
+ type-default values
+
+It makes no sense, because non-nullable columns can have NULL value.
+E.g. in "foo LEFT JOIN bar ON condition", the non-nullable columns of "bar"
+when it has no row matching "condition".
+
+Even when we are about to insert/update a row, we should not put a
+hard-coded value (that just happens to be the one constructed by the
+C++ default constructor for that type) in non-nullable columns: there
+is no guarantee that this value makes sense in that database's context.
+The database may or may not have a default value set for that column.
+If it has, we should leave it up to the database to set it automatically.
+If it has not, an error *is* the right reaction.
+
+Another place where this substitution does damage is when we refresh a
+row. We use the values we have read from the primary key to select the
+row again. So we should not mangle those, else the select returns no
+row and we mistakingly think the row has been deleted.
+
+Signed-off-by: Michael Meeks <michael.meeks at suse.com>
+---
+ dbaccess/source/core/api/CacheSet.cxx | 2 +-
+ dbaccess/source/core/api/KeySet.cxx | 10 +++++-----
+ dbaccess/source/core/api/OptimisticSet.cxx | 2 +-
+ 3 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx
+index ca3c4d1..7e18fa0 100644
+--- a/dbaccess/source/core/api/CacheSet.cxx
++++ b/dbaccess/source/core/api/CacheSet.cxx
+@@ -429,7 +429,7 @@ void OCacheSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 _nPosition)
+ for(sal_Int32 i=1;aIter != aEnd;++aIter,++i)
+ {
+ aIter->setSigned(m_aSignedFlags[i-1]);
+- aIter->fill(i,m_aColumnTypes[i-1],m_aNullable[i-1],this);
++ aIter->fill(i, m_aColumnTypes[i-1], this);
+ }
+ }
+
+diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
+index 5ae3385..407b700 100644
+--- a/dbaccess/source/core/api/KeySet.cxx
++++ b/dbaccess/source/core/api/KeySet.cxx
+@@ -758,7 +758,7 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString
+ #endif
+ SelectColumnsMetaData::iterator aFind = m_pKeyColumnNames->find(*aAutoIter);
+ if ( aFind != m_pKeyColumnNames->end() )
+- (_rInsertRow->get())[aFind->second.nPosition].fill(i,aFind->second.nType,aFind->second.bNullable,xRow);
++ (_rInsertRow->get())[aFind->second.nPosition].fill(i, aFind->second.nType, xRow);
+ }
+ bAutoValuesFetched = sal_True;
+ }
+@@ -818,7 +818,7 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString
+ // we will only fetch values which are keycolumns
+ SelectColumnsMetaData::iterator aFind = m_pKeyColumnNames->find(*aAutoIter);
+ if ( aFind != aEnd )
+- (_rInsertRow->get())[aFind->second.nPosition].fill(i,aFind->second.nType,aFind->second.bNullable,xRow);
++ (_rInsertRow->get())[aFind->second.nPosition].fill(i, aFind->second.nType, xRow);
+ }
+ }
+ ::comphelper::disposeComponent(xStatement);
+@@ -1335,13 +1335,13 @@ sal_Bool OKeySet::fetchRow()
+ {
+ ORowSetRow aKeyRow = new connectivity::ORowVector< ORowSetValue >((*m_pKeyColumnNames).size() + m_pForeignColumnNames->size());
+ connectivity::ORowVector< ORowSetValue >::Vector::iterator aIter = aKeyRow->get().begin();
+- // first fetch the values needed for the key column
++ // first fetch the values needed for the key columns
+ SelectColumnsMetaData::const_iterator aPosIter = (*m_pKeyColumnNames).begin();
+ SelectColumnsMetaData::const_iterator aPosEnd = (*m_pKeyColumnNames).end();
+ for(;aPosIter != aPosEnd;++aPosIter,++aIter)
+ {
+ const SelectColumnDescription& rColDesc = aPosIter->second;
+- aIter->fill(rColDesc.nPosition,rColDesc.nType,rColDesc.bNullable,m_xDriverRow);
++ aIter->fill(rColDesc.nPosition, rColDesc.nType, m_xDriverRow);
+ }
+ // now fetch the values from the missing columns from other tables
+ aPosIter = (*m_pForeignColumnNames).begin();
+@@ -1349,7 +1349,7 @@ sal_Bool OKeySet::fetchRow()
+ for(;aPosIter != aPosEnd;++aPosIter,++aIter)
+ {
+ const SelectColumnDescription& rColDesc = aPosIter->second;
+- aIter->fill(rColDesc.nPosition,rColDesc.nType,rColDesc.bNullable,m_xDriverRow);
++ aIter->fill(rColDesc.nPosition, rColDesc.nType, m_xDriverRow);
+ }
+ m_aKeyIter = m_aKeyMap.insert(OKeySetMatrix::value_type(m_aKeyMap.rbegin()->first+1,OKeySetValue(aKeyRow,::std::pair<sal_Int32,Reference<XRow> >(0,NULL)))).first;
+ }
+diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx
+index 38dba0e..a84eb9c 100644
+--- a/dbaccess/source/core/api/OptimisticSet.cxx
++++ b/dbaccess/source/core/api/OptimisticSet.cxx
+@@ -722,7 +722,7 @@ void OptimisticSet::fillMissingValues(ORowSetValueVector::Vector& io_aRow) const
+ {
+ if ( aColIter->second.sTableName == aSqlIter->first )
+ {
+- io_aRow[aColIter->second.nPosition].fill(i++,aColIter->second.nType,aColIter->second.bNullable,xRow);
++ io_aRow[aColIter->second.nPosition].fill(i++, aColIter->second.nType, xRow);
+ io_aRow[aColIter->second.nPosition].setModified();
+ }
+ }
+--
+1.7.7.6
+
diff --git a/0002-fdo-40261-Fix-crash-in-XML-Form-Document.patch b/0002-fdo-40261-Fix-crash-in-XML-Form-Document.patch
new file mode 100644
index 0000000..85f24c6
--- /dev/null
+++ b/0002-fdo-40261-Fix-crash-in-XML-Form-Document.patch
@@ -0,0 +1,389 @@
+From af14dfc2b5cf9d46ff8e425fdf6dee0978b7c135 Mon Sep 17 00:00:00 2001
+From: Jan Holesovsky <kendy at suse.cz>
+Date: Fri, 10 Feb 2012 14:12:17 +0100
+Subject: [PATCH 2/2] fdo#40261: Fix crash in XML Form Document.
+
+The data structure holding the UI elements in the browser listbox was a
+terrible mess - it held the items in an unordered_map, but then accessed
+them via a vector containing iterators to this unordered_map.
+
+Fixed the problem (and cleaned all this up) by removing the vector of
+iterators, and turning the unordered_map into a normal vector. When we need
+access by name, we just go through all the items; it is always just a handful
+of them anyway.
+
+Signed-off-by: Petr Mladek <pmladek at suse.cz>
+---
+ extensions/source/propctrlr/browserlistbox.cxx | 138 ++++++++++++------------
+ extensions/source/propctrlr/browserlistbox.hxx | 23 +---
+ 2 files changed, 73 insertions(+), 88 deletions(-)
+
+diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx
+index b24bc99..7eb1fcf 100644
+--- a/extensions/source/propctrlr/browserlistbox.cxx
++++ b/extensions/source/propctrlr/browserlistbox.cxx
+@@ -472,7 +472,7 @@ namespace pcr
+
+ UpdateVScroll();
+
+- sal_Bool bNeedScrollbar = m_aOrderedLines.size() > (sal_uInt32)CalcVisibleLines();
++ sal_Bool bNeedScrollbar = m_aLines.size() > (sal_uInt32)CalcVisibleLines();
+ if ( !bNeedScrollbar )
+ {
+ if ( m_aVScroll.IsVisible() )
+@@ -495,7 +495,7 @@ namespace pcr
+ m_aVScroll.SetPosSizePixel( aVScrollPos, aVScrollSize );
+ }
+
+- for ( sal_uInt16 i = 0; i < m_aOrderedLines.size(); ++i )
++ for ( sal_uInt16 i = 0; i < m_aLines.size(); ++i )
+ m_aOutOfDateLines.insert( i );
+
+ // repaint
+@@ -597,15 +597,16 @@ namespace pcr
+
+ aPos.Y() += _nIndex * m_nRowHeight;
+
+- if ( _nIndex < m_aOrderedLines.size() )
++ if ( _nIndex < m_aLines.size() )
+ {
+- m_aOrderedLines[ _nIndex ]->second.pLine->SetPosSizePixel( aPos, aSize );
++ BrowserLinePointer pLine = m_aLines[ _nIndex ].pLine;
+
+- m_aOrderedLines[ _nIndex ]->second.pLine->SetTitleWidth( m_nTheNameSize + 2 * FRAME_OFFSET );
++ pLine->SetPosSizePixel( aPos, aSize );
++ pLine->SetTitleWidth( m_nTheNameSize + 2 * FRAME_OFFSET );
+
+ // show the line if necessary
+- if ( !m_aOrderedLines[ _nIndex ]->second.pLine->IsVisible() )
+- m_aOrderedLines[ _nIndex ]->second.pLine->Show();
++ if ( !pLine->IsVisible() )
++ pLine->Show();
+ }
+ }
+
+@@ -617,8 +618,8 @@ namespace pcr
+ ++aLoop
+ )
+ {
+- DBG_ASSERT( *aLoop < m_aOrderedLines.size(), "OBrowserListBox::UpdatePosNSize: invalid line index!" );
+- if ( *aLoop < m_aOrderedLines.size() )
++ DBG_ASSERT( *aLoop < m_aLines.size(), "OBrowserListBox::UpdatePosNSize: invalid line index!" );
++ if ( *aLoop < m_aLines.size() )
+ PositionLine( *aLoop );
+ }
+ m_aOutOfDateLines.clear();
+@@ -631,10 +632,10 @@ namespace pcr
+ sal_Int32 nLines = CalcVisibleLines();
+
+ sal_uInt16 nEnd = (sal_uInt16)(nThumbPos + nLines);
+- if (nEnd >= m_aOrderedLines.size())
+- nEnd = (sal_uInt16)m_aOrderedLines.size()-1;
++ if (nEnd >= m_aLines.size())
++ nEnd = (sal_uInt16)m_aLines.size()-1;
+
+- if ( !m_aOrderedLines.empty() )
++ if ( !m_aLines.empty() )
+ {
+ for ( sal_uInt16 i = (sal_uInt16)nThumbPos; i <= nEnd; ++i )
+ m_aOutOfDateLines.insert( i );
+@@ -664,18 +665,21 @@ namespace pcr
+ //------------------------------------------------------------------
+ void OBrowserListBox::SetPropertyValue(const ::rtl::OUString& _rEntryName, const Any& _rValue, bool _bUnknownValue )
+ {
+- ListBoxLines::iterator line = m_aLines.find( _rEntryName );
++ ListBoxLines::iterator line = m_aLines.begin();
++ for ( ; line != m_aLines.end() && ( line->aName != _rEntryName ); ++line )
++ ;
++
+ if ( line != m_aLines.end() )
+ {
+ if ( _bUnknownValue )
+ {
+- Reference< XPropertyControl > xControl( line->second.pLine->getControl() );
++ Reference< XPropertyControl > xControl( line->pLine->getControl() );
+ OSL_ENSURE( xControl.is(), "OBrowserListBox::SetPropertyValue: illegal control!" );
+ if ( xControl.is() )
+ xControl->setValue( Any() );
+ }
+ else
+- impl_setControlAsPropertyValue( line->second, _rValue );
++ impl_setControlAsPropertyValue( *line, _rValue );
+ }
+ }
+
+@@ -683,14 +687,14 @@ namespace pcr
+ sal_uInt16 OBrowserListBox::GetPropertyPos( const ::rtl::OUString& _rEntryName ) const
+ {
+ sal_uInt16 nRet = LISTBOX_ENTRY_NOTFOUND;
+- for ( OrderedListBoxLines::const_iterator linePos = m_aOrderedLines.begin();
+- linePos != m_aOrderedLines.end();
++ for ( ListBoxLines::const_iterator linePos = m_aLines.begin();
++ linePos != m_aLines.end();
+ ++linePos
+ )
+ {
+- if ( (*linePos)->first == _rEntryName )
++ if ( linePos->aName == _rEntryName )
+ {
+- nRet = (sal_uInt16)( linePos - m_aOrderedLines.begin() );
++ nRet = (sal_uInt16)( linePos - m_aLines.begin() );
+ break;
+ }
+ }
+@@ -701,9 +705,12 @@ namespace pcr
+ //------------------------------------------------------------------------
+ bool OBrowserListBox::impl_getBrowserLineForName( const ::rtl::OUString& _rEntryName, BrowserLinePointer& _out_rpLine ) const
+ {
+- ListBoxLines::const_iterator line = m_aLines.find( _rEntryName );
++ ListBoxLines::const_iterator line = m_aLines.begin();
++ for ( ; line != m_aLines.end() && ( line->aName != _rEntryName ); ++line )
++ ;
++
+ if ( line != m_aLines.end() )
+- _out_rpLine = line->second.pLine;
++ _out_rpLine = line->pLine;
+ else
+ _out_rpLine.reset();
+ return ( NULL != _out_rpLine.get() );
+@@ -740,21 +747,21 @@ namespace pcr
+ // create a new line
+ BrowserLinePointer pBrowserLine( new OBrowserLine( _rPropertyData.sName, &m_aLinesPlayground ) );
+
+- ListBoxLine aNewLine( pBrowserLine, _rPropertyData.xPropertyHandler );
+- ::std::pair< ListBoxLines::iterator, bool > insertPoint =
+- m_aLines.insert( ListBoxLines::value_type( _rPropertyData.sName, aNewLine ) );
+- OSL_ENSURE( insertPoint.second, "OBrowserListBox::InsertEntry: already have another line for this name!" );
++ // check that the name is unique
++ ListBoxLines::iterator it = m_aLines.begin();
++ for ( ; it != m_aLines.end() && ( it->aName != _rPropertyData.sName ); ++it )
++ ;
++ OSL_ENSURE( it == m_aLines.end(), "OBrowserListBox::InsertEntry: already have another line for this name!" );
+
++ ListBoxLine aNewLine( _rPropertyData.sName, pBrowserLine, _rPropertyData.xPropertyHandler );
+ sal_uInt16 nInsertPos = _nPos;
+- if ( nInsertPos > m_aOrderedLines.size() )
+- nInsertPos = EDITOR_LIST_APPEND;
+- if ( EDITOR_LIST_APPEND == nInsertPos )
++ if ( _nPos >= m_aLines.size() )
+ {
+- nInsertPos = (sal_uInt16)m_aOrderedLines.size();
+- m_aOrderedLines.push_back( insertPoint.first );
++ nInsertPos = static_cast< sal_uInt16 >( m_aLines.size() );
++ m_aLines.push_back( aNewLine );
+ }
+ else
+- m_aOrderedLines.insert( m_aOrderedLines.begin() + nInsertPos, insertPoint.first );
++ m_aLines.insert( m_aLines.begin() + _nPos, aNewLine );
+
+ pBrowserLine->SetTitleWidth(m_nTheNameSize);
+ if (m_bUpdate)
+@@ -768,7 +775,7 @@ namespace pcr
+
+ // update the positions of possibly affected lines
+ sal_uInt16 nUpdatePos = nInsertPos;
+- while ( nUpdatePos < m_aOrderedLines.size() )
++ while ( nUpdatePos < m_aLines.size() )
+ m_aOutOfDateLines.insert( nUpdatePos++ );
+ UpdatePosNSize( );
+
+@@ -801,7 +808,7 @@ namespace pcr
+ //------------------------------------------------------------------
+ void OBrowserListBox::ShowEntry(sal_uInt16 _nPos)
+ {
+- if ( _nPos < m_aOrderedLines.size() )
++ if ( _nPos < m_aLines.size() )
+ {
+ sal_Int32 nThumbPos = m_aVScroll.GetThumbPos();
+
+@@ -968,12 +975,10 @@ namespace pcr
+ //------------------------------------------------------------------
+ sal_uInt16 OBrowserListBox::impl_getControlPos( const Reference< XPropertyControl >& _rxControl ) const
+ {
+- for ( OrderedListBoxLines::const_iterator search = m_aOrderedLines.begin();
+- search != m_aOrderedLines.end();
+- ++search
+- )
+- if ( (*search)->second.pLine->getControl().get() == _rxControl.get() )
+- return sal_uInt16( search - m_aOrderedLines.begin() );
++ for ( ListBoxLines::const_iterator search = m_aLines.begin(); search != m_aLines.end(); ++search )
++ if ( search->pLine->getControl().get() == _rxControl.get() )
++ return sal_uInt16( search - m_aLines.begin() );
++
+ OSL_FAIL( "OBrowserListBox::impl_getControlPos: invalid control - not part of any of our lines!" );
+ return (sal_uInt16)-1;
+ }
+@@ -1008,7 +1013,7 @@ namespace pcr
+
+ if ( m_pLineListener )
+ {
+- const ListBoxLine& rLine = impl_getControlLine( _rxControl );
++ const ListBoxLine& rLine = m_aLines[ impl_getControlPos( _rxControl ) ];
+ m_pLineListener->Commit(
+ rLine.pLine->GetEntryName(),
+ impl_getControlAsPropertyValue( rLine )
+@@ -1025,18 +1030,16 @@ namespace pcr
+
+ // cycle forwards, 'til we've the next control which can grab the focus
+ ++nLine;
+- while ( (size_t)nLine < m_aOrderedLines.size() )
++ while ( static_cast< size_t >( nLine ) < m_aLines.size() )
+ {
+- if ( m_aOrderedLines[nLine]->second.pLine->GrabFocus() )
++ if ( m_aLines[nLine].pLine->GrabFocus() )
+ break;
+ ++nLine;
+ }
+
+- if ( ( (size_t)nLine >= m_aOrderedLines.size() )
+- && ( m_aOrderedLines.size() > 0 )
+- )
+- // wrap around
+- m_aOrderedLines[0]->second.pLine->GrabFocus();
++ // wrap around?
++ if ( ( static_cast< size_t >( nLine ) >= m_aLines.size() ) && ( m_aLines.size() > 0 ) )
++ m_aLines[0].pLine->GrabFocus();
+ }
+
+ //------------------------------------------------------------------
+@@ -1064,40 +1067,33 @@ namespace pcr
+ //------------------------------------------------------------------
+ void OBrowserListBox::Clear()
+ {
+- for ( ListBoxLines::iterator loop = m_aLines.begin();
+- loop != m_aLines.end();
+- ++loop
+- )
++ for ( ListBoxLines::iterator loop = m_aLines.begin(); loop != m_aLines.end(); ++loop )
+ {
+ // hide the line
+- loop->second.pLine->Hide();
++ loop->pLine->Hide();
+ // reset the listener
+- lcl_implDisposeControl_nothrow( loop->second.pLine->getControl() );
++ lcl_implDisposeControl_nothrow( loop->pLine->getControl() );
+ }
+
+ clearContainer( m_aLines );
+- clearContainer( m_aOrderedLines );
+ }
+
+ //------------------------------------------------------------------
+ sal_Bool OBrowserListBox::RemoveEntry( const ::rtl::OUString& _rName )
+ {
+- sal_uInt16 nPos = GetPropertyPos( _rName );
+- if ( nPos == LISTBOX_ENTRY_NOTFOUND )
+- return sal_False;
++ sal_uInt16 nPos = 0;
++ ListBoxLines::iterator it = m_aLines.begin();
++ for ( ; it != m_aLines.end() && ( it->aName != _rName ); ++it, ++nPos )
++ ;
+
+- OrderedListBoxLines::iterator orderedPos = m_aOrderedLines.begin() + nPos;
+- BrowserLinePointer pLine = (*orderedPos)->second.pLine;
+- pLine->Hide();
+- lcl_implDisposeControl_nothrow( pLine->getControl() );
++ if ( it == m_aLines.end() )
++ return sal_False;
+
+- m_aLines.erase( *orderedPos );
+- m_aOrderedLines.erase( orderedPos );
+- m_aOutOfDateLines.erase( (sal_uInt16)m_aOrderedLines.size() );
+- // this index *may* have been out of date, which is obsoleted now by m_aOrderedLines shrinking
++ m_aLines.erase( it );
++ m_aOutOfDateLines.erase( (sal_uInt16)m_aLines.size() );
+
+ // update the positions of possibly affected lines
+- while ( nPos < m_aOrderedLines.size() )
++ while ( nPos < m_aLines.size() )
+ m_aOutOfDateLines.insert( nPos++ );
+ UpdatePosNSize( );
+
+@@ -1114,14 +1110,14 @@ namespace pcr
+ if ( nPos == EDITOR_LIST_REPLACE_EXISTING )
+ nPos = GetPropertyPos( _rPropertyData.sName );
+
+- if ( nPos < m_aOrderedLines.size() )
++ if ( nPos < m_aLines.size() )
+ {
+ Window* pRefWindow = NULL;
+ if ( nPos > 0 )
+- pRefWindow = m_aOrderedLines[nPos-1]->second.pLine->GetRefWindow();
++ pRefWindow = m_aLines[nPos-1].pLine->GetRefWindow();
+
+ // the current line and control
+- ListBoxLine& rLine = m_aOrderedLines[nPos]->second;
++ ListBoxLine& rLine = m_aLines[nPos];
+
+ // the old control and some data about it
+ Reference< XPropertyControl > xControl = rLine.pLine->getControl();
+@@ -1259,9 +1255,9 @@ namespace pcr
+ nFocusControlPos = (sal_uInt16)nNewThumbPos + CalcVisibleLines() - 1;
+ if ( nFocusControlPos )
+ {
+- if ( nFocusControlPos < m_aOrderedLines.size() )
++ if ( nFocusControlPos < m_aLines.size() )
+ {
+- m_aOrderedLines[ nFocusControlPos ]->second.pLine->GrabFocus();
++ m_aLines[ nFocusControlPos ].pLine->GrabFocus();
+ }
+ else
+ OSL_FAIL( "OBrowserListBox::PreNotify: internal error, invalid focus control position!" );
+diff --git a/extensions/source/propctrlr/browserlistbox.hxx b/extensions/source/propctrlr/browserlistbox.hxx
+index 36a471f..f7558ce 100644
+--- a/extensions/source/propctrlr/browserlistbox.hxx
++++ b/extensions/source/propctrlr/browserlistbox.hxx
+@@ -65,19 +65,19 @@ namespace pcr
+ typedef ::boost::shared_ptr< OBrowserLine > BrowserLinePointer;
+ struct ListBoxLine
+ {
++ ::rtl::OUString aName;
+ BrowserLinePointer pLine;
+ ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler >
+ xHandler;
+
+- ListBoxLine() { }
+- ListBoxLine( BrowserLinePointer _pLine, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler >& _rxHandler )
+- :pLine( _pLine )
+- ,xHandler( _rxHandler )
++ ListBoxLine( const ::rtl::OUString& rName, BrowserLinePointer _pLine, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler >& _rxHandler )
++ : aName( rName ),
++ pLine( _pLine ),
++ xHandler( _rxHandler )
+ {
+ }
+ };
+- typedef ::boost::unordered_map< ::rtl::OUString, ListBoxLine, ::rtl::OUStringHash > ListBoxLines;
+- typedef ::std::vector< ListBoxLines::iterator > OrderedListBoxLines;
++ typedef ::std::vector< ListBoxLine > ListBoxLines;
+
+ //========================================================================
+ //= IControlContext
+@@ -106,7 +106,6 @@ namespace pcr
+ ::std::auto_ptr< InspectorHelpWindow >
+ m_pHelpWindow;
+ ListBoxLines m_aLines;
+- OrderedListBoxLines m_aOrderedLines;
+ IPropertyLineListener* m_pLineListener;
+ IPropertyControlObserver* m_pControlObserver;
+ long m_nYOffset;
+@@ -192,16 +191,6 @@ namespace pcr
+ */
+ sal_uInt16 impl_getControlPos( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& _rxControl ) const;
+
+- /** retrieves (a reference to) the ->ListBoxLine for a given control
+- @param _rxControl
+- The control to lookup. Must denote a control of one of the lines in ->m_aLines
+- */
+- inline const ListBoxLine&
+- impl_getControlLine( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& _rxControl ) const
+- {
+- return m_aOrderedLines[ impl_getControlPos( _rxControl ) ]->second;
+- }
+-
+ /** sets the given property value at the given control, after converting it as necessary
+ @param _rLine
+ The line whose at which the value is to be set.
+--
+1.7.7.6
+
diff --git a/0002-fdo-44813-make-the-refresh-query-filter-NULL-safe.patch b/0002-fdo-44813-make-the-refresh-query-filter-NULL-safe.patch
new file mode 100644
index 0000000..affd8a7
--- /dev/null
+++ b/0002-fdo-44813-make-the-refresh-query-filter-NULL-safe.patch
@@ -0,0 +1,159 @@
+From ee6e71cc5fcfda258ca2ce8e61544601e891eae6 Mon Sep 17 00:00:00 2001
+From: Lionel Elie Mamane <lionel at mamane.lu>
+Date: Wed, 18 Jan 2012 12:30:36 +0100
+Subject: [PATCH 2/2] fdo#44813: make the refresh query filter NULL-safe
+
+Signed-off-by: Michael Meeks <michael.meeks at suse.com>
+---
+ dbaccess/source/core/api/KeySet.cxx | 77 ++++++++++++++++++++++++----------
+ dbaccess/source/core/api/KeySet.hxx | 5 ++
+ 2 files changed, 59 insertions(+), 23 deletions(-)
+
+diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
+index 407b700..8c7f83a 100644
+--- a/dbaccess/source/core/api/KeySet.cxx
++++ b/dbaccess/source/core/api/KeySet.cxx
+@@ -219,22 +219,56 @@ void OKeySet::findTableColumnsMatching_throw( const Any& i_aTable,
+ m_aAutoColumns.push_back( keyColumn->first );
+ }
+ }
++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(" ( 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);
++ o_buf.append(s_sDot);
++ o_buf.append(colName);
++ o_buf.append(s_sParam1);
++ o_buf.append(tblName);
++ o_buf.append(s_sDot);
++ o_buf.append(colName);
++ o_buf.append(s_sParam2);
++ }
++}
++
++void OKeySet::setOneKeyColumnParameter( sal_Int32 &nPos, const Reference< XParameters > &_xParameter, const connectivity::ORowSetValue &_rValue, sal_Int32 _nType, sal_Int32 _nScale ) const
++{
++ if ( _rValue.isNull() )
++ {
++ _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->setByte( nPos++, 1 );
++ }
++ else
++ {
++ _xParameter->setByte( nPos++, 1 );
++ setParameter( nPos++, _xParameter, _rValue, _nType, _nScale );
++ _xParameter->setByte( nPos++, 0 );
++ }
++}
++
+ ::rtl::OUStringBuffer OKeySet::createKeyFilter()
+ {
+ static ::rtl::OUString aAnd(RTL_CONSTASCII_USTRINGPARAM(" AND "));
+- const ::rtl::OUString aQuote = getIdentifierQuoteString();
++ const ::rtl::OUString aQuote = getIdentifierQuoteString();
+ ::rtl::OUStringBuffer aFilter;
+- static ::rtl::OUString s_sDot(RTL_CONSTASCII_USTRINGPARAM("."));
+- static ::rtl::OUString s_sParam(RTL_CONSTASCII_USTRINGPARAM(" = ?"));
+ // create the where clause
+ Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData();
+ SelectColumnsMetaData::iterator aPosEnd = m_pKeyColumnNames->end();
+ for(SelectColumnsMetaData::iterator aPosIter = m_pKeyColumnNames->begin();aPosIter != aPosEnd;)
+ {
+- aFilter.append(::dbtools::quoteTableName( xMeta,aPosIter->second.sTableName,::dbtools::eInDataManipulation));
+- aFilter.append(s_sDot);
+- aFilter.append(::dbtools::quoteName( aQuote,aPosIter->second.sRealName));
+- aFilter.append(s_sParam);
++ appendOneKeyColumnClause(::dbtools::quoteTableName( xMeta,aPosIter->second.sTableName,::dbtools::eInDataManipulation),
++ ::dbtools::quoteName( aQuote,aPosIter->second.sRealName),
++ aFilter);
+ ++aPosIter;
+ if(aPosIter != aPosEnd)
+ aFilter.append(aAnd);
+@@ -272,8 +306,6 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet,const ::rtl::O
+ {
+ static ::rtl::OUString aAnd(RTL_CONSTASCII_USTRINGPARAM(" AND "));
+ const ::rtl::OUString aQuote = getIdentifierQuoteString();
+- static ::rtl::OUString s_sDot(RTL_CONSTASCII_USTRINGPARAM("."));
+- static ::rtl::OUString s_sParam(RTL_CONSTASCII_USTRINGPARAM(" = ?"));
+ const ::rtl::OUString* pIter = aSeq.getConstArray();
+ const ::rtl::OUString* pEnd = pIter + aSeq.getLength();
+ for(;pIter != pEnd;++pIter)
+@@ -290,12 +322,11 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet,const ::rtl::O
+ for(SelectColumnsMetaData::iterator aPosIter = (*m_pForeignColumnNames).begin();aPosIter != aPosEnd;++aPosIter)
+ {
+ // look for columns not in the source columns to use them as filter as well
+- if ( aFilter.getLength() )
+- aFilter.append(aAnd);
+- aFilter.append(::dbtools::quoteName( aQuote,sSelectTableName));
+- aFilter.append(s_sDot);
+- aFilter.append(::dbtools::quoteName( aQuote,aPosIter->second.sRealName));
+- aFilter.append(s_sParam);
++ if ( aFilter.getLength() )
++ aFilter.append(aAnd);
++ appendOneKeyColumnClause(::dbtools::quoteName( aQuote,sSelectTableName),
++ ::dbtools::quoteName( aQuote,aPosIter->second.sRealName),
++ aFilter);
+ }
+ break;
+ }
+@@ -875,12 +906,12 @@ void OKeySet::tryRefetch(const ORowSetRow& _rInsertRow,bool bRefetch)
+ connectivity::ORowVector< ORowSetValue >::Vector::const_iterator aIter2 = m_aKeyIter->second.first->get().begin();
+ SelectColumnsMetaData::const_iterator aPosIter = (*m_pKeyColumnNames).begin();
+ SelectColumnsMetaData::const_iterator aPosEnd = (*m_pKeyColumnNames).end();
+- for(;aPosIter != aPosEnd;++aPosIter,++aIter2,++nPos)
+- setParameter(nPos,xParameter,*aIter2,aPosIter->second.nType,aPosIter->second.nScale);
++ for(;aPosIter != aPosEnd;++aPosIter,++aIter2)
++ setOneKeyColumnParameter(nPos,xParameter,*aIter2,aPosIter->second.nType,aPosIter->second.nScale);
+ aPosIter = (*m_pForeignColumnNames).begin();
+ aPosEnd = (*m_pForeignColumnNames).end();
+- for(;aPosIter != aPosEnd;++aPosIter,++aIter2,++nPos)
+- setParameter(nPos,xParameter,*aIter2,aPosIter->second.nType,aPosIter->second.nScale);
++ for(;aPosIter != aPosEnd;++aPosIter,++aIter2)
++ setOneKeyColumnParameter(nPos,xParameter,*aIter2,aPosIter->second.nType,aPosIter->second.nScale);
+
+ m_xSet = m_xStatement->executeQuery();
+ OSL_ENSURE(m_xSet.is(),"No resultset form statement!");
+@@ -1308,12 +1339,12 @@ void SAL_CALL OKeySet::refreshRow() throw(SQLException, RuntimeException)
+ connectivity::ORowVector< ORowSetValue >::Vector::const_iterator aIter = m_aKeyIter->second.first->get().begin();
+ SelectColumnsMetaData::const_iterator aPosIter = (*m_pKeyColumnNames).begin();
+ SelectColumnsMetaData::const_iterator aPosEnd = (*m_pKeyColumnNames).end();
+- for(;aPosIter != aPosEnd;++aPosIter,++aIter,++nPos)
+- setParameter(nPos,xParameter,*aIter,aPosIter->second.nType,aPosIter->second.nScale);
++ for(;aPosIter != aPosEnd;++aPosIter,++aIter)
++ setOneKeyColumnParameter(nPos,xParameter,*aIter,aPosIter->second.nType,aPosIter->second.nScale);
+ aPosIter = (*m_pForeignColumnNames).begin();
+ aPosEnd = (*m_pForeignColumnNames).end();
+- for(;aPosIter != aPosEnd;++aPosIter,++aIter,++nPos)
+- setParameter(nPos,xParameter,*aIter,aPosIter->second.nType,aPosIter->second.nScale);
++ for(;aPosIter != aPosEnd;++aPosIter,++aIter)
++ setOneKeyColumnParameter(nPos,xParameter,*aIter,aPosIter->second.nType,aPosIter->second.nScale);
+
+ m_xSet = m_xStatement->executeQuery();
+ OSL_ENSURE(m_xSet.is(),"No resultset form statement!");
+diff --git a/dbaccess/source/core/api/KeySet.hxx b/dbaccess/source/core/api/KeySet.hxx
+index 826ec1a..84781d4 100644
+--- a/dbaccess/source/core/api/KeySet.hxx
++++ b/dbaccess/source/core/api/KeySet.hxx
+@@ -138,6 +138,11 @@ namespace dbaccess
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData>& i_xMeta,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& i_xQueryColumns,
+ ::std::auto_ptr<SelectColumnsMetaData>& o_pKeyColumnNames);
++ void setOneKeyColumnParameter( sal_Int32 &nPos,
++ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XParameters > &_xParameter,
++ const connectivity::ORowSetValue &_rValue,
++ sal_Int32 _nType,
++ sal_Int32 _nScale ) const;
+ ::rtl::OUStringBuffer createKeyFilter();
+ void tryRefetch(const ORowSetRow& _rInsertRow,bool bRefetch);
+ void executeUpdate(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrginalRow,const ::rtl::OUString& i_sSQL,const ::rtl::OUString& i_sTableName,const ::std::vector<sal_Int32>& _aIndexColumnPositions = ::std::vector<sal_Int32>());
+--
+1.7.7.6
+
diff --git a/0002-odbc-64-bit-crash-correct-buffer-length-allocation-f.patch b/0002-odbc-64-bit-crash-correct-buffer-length-allocation-f.patch
new file mode 100644
index 0000000..1ebf792
--- /dev/null
+++ b/0002-odbc-64-bit-crash-correct-buffer-length-allocation-f.patch
@@ -0,0 +1,29 @@
+From adb1ed5f13b4638690ca2966138eb2c61bdb1b53 Mon Sep 17 00:00:00 2001
+From: Lionel Elie Mamane <lionel at mamane.lu>
+Date: Tue, 14 Feb 2012 14:54:03 +0100
+Subject: [PATCH 2/2] odbc 64 bit crash: correct buffer length allocation for
+ a SQLLEN
+
+(cherry picked from commit 84d21e4de26bd69f7ca5b10f2c72779f07e11347)
+
+Signed-off-by: Michael Stahl <mstahl at redhat.com>
+---
+ connectivity/source/inc/odbc/OBoundParam.hxx | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/connectivity/source/inc/odbc/OBoundParam.hxx b/connectivity/source/inc/odbc/OBoundParam.hxx
+index 5817aac..b8856e9 100644
+--- a/connectivity/source/inc/odbc/OBoundParam.hxx
++++ b/connectivity/source/inc/odbc/OBoundParam.hxx
+@@ -68,7 +68,7 @@ namespace connectivity
+ // to a Java sal_Int32. The jdbcodbc 'C' bridge provides an
+ // interface to do this.
+
+- paramLength = new sal_Int8[4];
++ paramLength = new sal_Int8[sizeof(SQLLEN)];
+ }
+
+ //--------------------------------------------------------------------
+--
+1.7.7.6
+
diff --git a/libreoffice.spec b/libreoffice.spec
index 3067534..25eda74 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -211,6 +211,12 @@ Patch92: 0001-fdo-36109-in-INDIRECT-make-a-non-existing-sheet-prod.patch
Patch93: 0001-fdo-41712-rename-members-to-track-down-assignments.patch
Patch94: 0002-fdo-41712-sw-fix-crash-in-layout-frame-linked-lists.patch
Patch95: 0003-fdo-41712-sw-remove-superfluous-flag.patch
+Patch96: 0001-fdo-42771-Fix-crash-when-loading-an-invalid-.fodt.patch
+Patch97: 0002-odbc-64-bit-crash-correct-buffer-length-allocation-f.patch
+Patch98: 0001-fdo-44813-don-t-replace-NULLs-given-by-the-database-.patch
+Patch99: 0002-fdo-44813-make-the-refresh-query-filter-NULL-safe.patch
+Patch100: 0001-fdo-43399-hidden-radio-button-should-also-gets-unset.patch
+Patch101: 0002-fdo-40261-Fix-crash-in-XML-Form-Document.patch
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%define instdir %{_libdir}
@@ -1105,6 +1111,12 @@ mv -f redhat.soc extras/source/palettes/standard.soc
%patch93 -p1 -b .fdo-41712-rename-members-to-track-down-assignments.patch
%patch94 -p1 -b .fdo-41712-sw-fix-crash-in-layout-frame-linked-lists.patch
%patch95 -p1 -b .fdo-41712-sw-remove-superfluous-flag.patch
+%patch96 -p1 -b .fdo-42771-Fix-crash-when-loading-an-invalid-.fodt.patch
+%patch97 -p1 -b .odbc-64-bit-crash-correct-buffer-length-allocation-f.patch
+%patch98 -p1 -b .fdo-44813-don-t-replace-NULLs-given-by-the-database-.patch
+%patch99 -p1 -b .fdo-44813-make-the-refresh-query-filter-NULL-safe.patch
+%patch100 -p1 -b .fdo-43399-hidden-radio-button-should-also-gets-unset.patch
+%patch101 -p1 -b .fdo-40261-Fix-crash-in-XML-Form-Document.patch
# these are horribly incomplete--empty translations and copied english
# strings with spattering of translated strings
@@ -2421,6 +2433,10 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
.pyc's and .pyo's have the same content (timestamp in binary cache)
- Resolves: fdo#36109 in INDIRECT() make a non-existing sheet produce an error again
- Resolves: fdo#41712 sw: fix crash in layout frame linked lists
+- Resolves: fdo#42771 Fix crash when loading an invalid .fodt
+- Resolves: fdo#44813 make the refresh query filter NULL-safe
+- Resolves: fdo#43399 hidden radio button should also gets unset
+- Resolves: fdo#40261 Fix crash in XML Form Document
* Thu Feb 09 2012 Caolán McNamara <caolanm at redhat.com> - 3.4.5.2-5
- Resolves: fdo#38595 border width lost in ODF import
More information about the scm-commits
mailing list