accessibility/source/standard/vclxaccessiblebox.cxx | 22 accessibility/source/standard/vclxaccessiblelist.cxx | 33 basic/source/runtime/methods.cxx | 8 cui/source/tabpages/tparea.cxx | 46 extras/source/autocorr/lang/en-AU/SentenceExceptList.xml | 2 extras/source/autocorr/lang/en-GB/SentenceExceptList.xml | 2 extras/source/autocorr/lang/en-US/SentenceExceptList.xml | 2 extras/source/autocorr/lang/en-ZA/SentenceExceptList.xml | 2 librelogo/source/LibreLogo/LibreLogo.py | 1 officecfg/registry/schema/org/openoffice/Office/Common.xcs | 2 oox/source/export/chartexport.cxx | 4 readlicense_oo/license/CREDITS.fodt | 3389 ++++++------- sc/inc/column.hxx | 2 sc/source/core/data/column2.cxx | 15 sc/source/core/tool/grouparealistener.cxx | 43 sc/source/filter/excel/xelink.cxx | 3 sc/source/filter/excel/xestyle.cxx | 12 sc/source/filter/excel/xichart.cxx | 51 sd/source/filter/eppt/epptso.cxx | 348 - setup_native/source/packinfo/packinfo_office.txt | 8 solenv/gcc-wrappers/wrapper.cxx | 5 svx/source/gallery2/galctrl.cxx | 1 svx/source/tbxctrls/tbcontrl.cxx | 184 sw/inc/swunohelper.hxx | 2 sw/qa/extras/rtfimport/data/tdf86182.rtf | 4 sw/qa/extras/rtfimport/rtfimport.cxx | 7 sw/source/core/unocore/swunohelper.cxx | 53 sw/source/core/unocore/unoframe.cxx | 20 sw/source/core/unocore/unomap.cxx | 8 sw/source/core/unocore/unoparagraph.cxx | 5 sw/source/core/unocore/unostyle.cxx | 23 sw/source/filter/ww8/ww8atr.cxx | 6 vcl/osx/salframe.cxx | 1 vcl/source/outdev/text.cxx | 3 writerfilter/source/rtftok/rtfdocumentimpl.cxx | 2 xmloff/source/text/txtexppr.cxx | 53 xmloff/source/text/txtprmap.cxx | 35 37 files changed, 2417 insertions(+), 1990 deletions(-)
New commits: commit a79bf4f4e44a4b76cbbc527facbac637a0e24417 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Fri Apr 17 10:44:47 2015 +0200 tdf#86182 RTF import: fix handling of \rtlpar Commit 558d5c25a0b1d6a937d33291a4b6cd7fca6cb15b (implement RTF_LTRPAR and RTF_RTLPAR, 2011-06-09) was just a guess, this one is the proper mapping. (cherry picked from commit 4ee2a882dddb395a816cd54004b634d57cfb2446) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx writerfilter/source/rtftok/rtfdocumentimpl.cxx Change-Id: I1156ef5ddc34264d761d3e64dd0537bc6ec0ced7 Reviewed-on: https://gerrit.libreoffice.org/15481 Reviewed-by: Michael Stahl <mst...@redhat.com> Tested-by: Michael Stahl <mst...@redhat.com> diff --git a/sw/qa/extras/rtfimport/data/tdf86182.rtf b/sw/qa/extras/rtfimport/data/tdf86182.rtf new file mode 100644 index 0000000..d63c489 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/tdf86182.rtf @@ -0,0 +1,4 @@ +{\rtf1 +\rtlpar +\u1662\'3f\u1587\'3f +\par} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 8dce8ee..6c52362 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -45,6 +45,7 @@ #include <com/sun/star/text/WrapTextMode.hpp> #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/VertOrientation.hpp> +#include <com/sun/star/text/WritingMode2.hpp> #include <com/sun/star/util/XNumberFormatsSupplier.hpp> #include <rtl/ustring.hxx> @@ -2258,6 +2259,12 @@ DECLARE_RTFIMPORT_TEST(testFdo75614, "tdf75614.rtf") CPPUNIT_ASSERT_EQUAL(OUString("after."), getRun(getParagraph(1), 3)->getString()); } +DECLARE_RTFIMPORT_TEST(testTdf86182, "tdf86182.rtf") +{ + // Writing mode was the default, i.e. text::WritingMode2::CONTEXT. + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>(getParagraph(1), "WritingMode")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index d589598..ad9954b 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -3028,7 +3028,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) case RTF_RTLPAR: { RTFValue::Pointer_t pValue(new RTFValue(nKeyword == RTF_LTRPAR ? 0 : 1)); - m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_CT_PPrBase_textDirection, pValue); + m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_CT_PPrBase_bidi, pValue); } break; case RTF_LTRROW: commit 53094acb9eac8cdc6af2ac8b9a45b95a001dbaf8 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Apr 22 12:07:27 2015 +0100 fix re-export of novell590442-1.ppt to ppt we always open a container, so always close it the close container is inside the nRowCount != 0 condition, so remove that and always write the close (cherry picked from commit 7aa166da24c81b7c22a0ec5daf7e09640ffb009b) Conflicts: sd/source/filter/eppt/epptso.cxx fix re-export of novell590442-1.ppt to ppt we always close this container, even if we didn't open it original commit always opened the SpgrContainer, and always closed the SpgrContainer. (but seems to have a loophole, presumably never hit where the SpContainer could be opened and not closed) make a container guard which opens in ctor and closes in dtor. should make ppt export crash stats hit 0 (cherry picked from commit deaed8aff6de824a76d939a02edb0d2ff4a4ccec) squash patch here is unreadable, but component parts are fairly trivial, remove nRowCount guard and unindent block, and then add in helper and use that to push/pop containers Change-Id: If05677ae46e8873b8780794bdd84f29505ea4112 2aead7397448b674e433a4097c97285067a6dc6e Reviewed-on: https://gerrit.libreoffice.org/15478 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 1082b6b..3c74ce6 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -3570,6 +3570,22 @@ void PPTWriter::WriteCString( SvStream& rSt, const OUString& rString, sal_uInt32 } } +class ContainerGuard +{ +private: + PptEscherEx* m_pPptEscherEx; +public: + ContainerGuard(PptEscherEx* pPptEscherEx, sal_uInt16 nRecord) + : m_pPptEscherEx(pPptEscherEx) + { + m_pPptEscherEx->OpenContainer(nRecord); + } + ~ContainerGuard() + { + m_pPptEscherEx->CloseContainer(); + } +}; + void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, EscherSolverContainer& aSolverContainer, EscherPropertyContainer& aPropOpt ) { @@ -3617,8 +3633,8 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc if ( y == nRowCount - 1 && nPosition != maRect.Bottom()) maRect.Bottom() = nPosition; } - mpPptEscherEx->OpenContainer( ESCHER_SpgrContainer ); - mpPptEscherEx->OpenContainer( ESCHER_SpContainer ); + std::unique_ptr<ContainerGuard> xSpgrContainer(new ContainerGuard(mpPptEscherEx, ESCHER_SpgrContainer)); + std::unique_ptr<ContainerGuard> xSpContainer(new ContainerGuard(mpPptEscherEx, ESCHER_SpContainer)); mpPptEscherEx->AddAtom( 16, ESCHER_Spgr, 1 ); mpStrm ->WriteInt32( maRect.Left() ) // Bounding box for the grouped shapes to which they are attached .WriteInt32( maRect.Top() ) @@ -3630,214 +3646,212 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc aSolverContainer.AddShape( rXShape, nShapeId ); EscherPropertyContainer aPropOpt2; - if ( nRowCount ) - { - SvMemoryStream aMemStrm; - aMemStrm.ObjectOwnsMemory( false ); - aMemStrm.WriteUInt16( nRowCount ) - .WriteUInt16( nRowCount ) - .WriteUInt16( 4 ); - - std::vector< std::pair< sal_Int32, sal_Int32 > >::const_iterator aIter( aRows.begin() ); - while( aIter != aRows.end() ) - aMemStrm.WriteInt32( (*aIter++).second ); - - aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x1000100 ); - aPropOpt2.AddOpt( ESCHER_Prop_tableProperties, 1 ); - aPropOpt2.AddOpt( ESCHER_Prop_tableRowProperties, true, aMemStrm.Tell(), static_cast< sal_uInt8* >( const_cast< void* >( aMemStrm.GetData() ) ), aMemStrm.Tell() ); - aPropOpt.CreateShapeProperties( rXShape ); - aPropOpt.Commit( *mpStrm ); - aPropOpt2.Commit( *mpStrm, 3, ESCHER_UDefProp ); - if ( GetCurrentGroupLevel() > 0 ) - mpPptEscherEx->AddChildAnchor( maRect ); - else - mpPptEscherEx->AddClientAnchor( maRect ); - mpPptEscherEx->CloseContainer(); + SvMemoryStream aMemStrm; + aMemStrm.ObjectOwnsMemory( false ); + aMemStrm.WriteUInt16( nRowCount ) + .WriteUInt16( nRowCount ) + .WriteUInt16( 4 ); - uno::Reference< table::XCellRange > xCellRange( xTable, uno::UNO_QUERY_THROW ); - for( sal_Int32 nRow = 0; nRow < xRows->getCount(); nRow++ ) + std::vector< std::pair< sal_Int32, sal_Int32 > >::const_iterator aIter( aRows.begin() ); + while( aIter != aRows.end() ) + aMemStrm.WriteInt32( (*aIter++).second ); + + aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x1000100 ); + aPropOpt2.AddOpt( ESCHER_Prop_tableProperties, 1 ); + aPropOpt2.AddOpt( ESCHER_Prop_tableRowProperties, true, aMemStrm.Tell(), static_cast< sal_uInt8* >( const_cast< void* >( aMemStrm.GetData() ) ), aMemStrm.Tell() ); + aPropOpt.CreateShapeProperties( rXShape ); + aPropOpt.Commit( *mpStrm ); + aPropOpt2.Commit( *mpStrm, 3, ESCHER_UDefProp ); + if ( GetCurrentGroupLevel() > 0 ) + mpPptEscherEx->AddChildAnchor( maRect ); + else + mpPptEscherEx->AddClientAnchor( maRect ); + xSpContainer.reset(); //ESCHER_SpContainer + + uno::Reference< table::XCellRange > xCellRange( xTable, uno::UNO_QUERY_THROW ); + for( sal_Int32 nRow = 0; nRow < xRows->getCount(); nRow++ ) + { + for( sal_Int32 nColumn = 0; nColumn < xColumns->getCount(); nColumn++ ) { - for( sal_Int32 nColumn = 0; nColumn < xColumns->getCount(); nColumn++ ) + uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nRow ), uno::UNO_QUERY_THROW ); + if ( !xCell->isMerged() ) { - uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nRow ), uno::UNO_QUERY_THROW ); - if ( !xCell->isMerged() ) - { - sal_Int32 nLeft = aColumns[ nColumn ].first; - sal_Int32 nTop = aRows[ nRow ].first; - sal_Int32 nRight = GetCellRight( nColumn, maRect,aColumns,xCell ); - sal_Int32 nBottom = GetCellBottom( nRow, maRect,aRows,xCell ); - - mbFontIndependentLineSpacing = false; - mXPropSet = uno::Reference< beans::XPropertySet >( xCell, uno::UNO_QUERY_THROW ); - mXText = uno::Reference< text::XSimpleText >( xCell, uno::UNO_QUERY_THROW ); - mnTextSize = mXText->getString().getLength(); + sal_Int32 nLeft = aColumns[ nColumn ].first; + sal_Int32 nTop = aRows[ nRow ].first; + sal_Int32 nRight = GetCellRight( nColumn, maRect,aColumns,xCell ); + sal_Int32 nBottom = GetCellBottom( nRow, maRect,aRows,xCell ); + + mbFontIndependentLineSpacing = false; + mXPropSet = uno::Reference< beans::XPropertySet >( xCell, uno::UNO_QUERY_THROW ); + mXText = uno::Reference< text::XSimpleText >( xCell, uno::UNO_QUERY_THROW ); + mnTextSize = mXText->getString().getLength(); - ::com::sun::star::uno::Any aAny; - if ( GetPropertyValue( aAny, mXPropSet, OUString( "FontIndependentLineSpacing" ) ), sal_True ) - aAny >>= mbFontIndependentLineSpacing; + ::com::sun::star::uno::Any aAny; + if ( GetPropertyValue( aAny, mXPropSet, OUString( "FontIndependentLineSpacing" ) ), sal_True ) + aAny >>= mbFontIndependentLineSpacing; - EscherPropertyContainer aPropOptSp; - mpPptEscherEx->OpenContainer( ESCHER_SpContainer ); - ImplCreateShape( ESCHER_ShpInst_Rectangle, 0xa02, aSolverContainer ); // Flags: Connector | HasSpt | Child - aPropOptSp.CreateFillProperties( mXPropSet, true ); - aPropOptSp.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90000 ); - aPropOptSp.CreateTextProperties( mXPropSet, mnTxId += 0x60, false, true ); - aPropOptSp.AddOpt( ESCHER_Prop_WrapText, ESCHER_WrapSquare ); + EscherPropertyContainer aPropOptSp; + std::unique_ptr<ContainerGuard> xCellContainer(new ContainerGuard(mpPptEscherEx, ESCHER_SpContainer)); + ImplCreateShape( ESCHER_ShpInst_Rectangle, 0xa02, aSolverContainer ); // Flags: Connector | HasSpt | Child + aPropOptSp.CreateFillProperties( mXPropSet, true ); + aPropOptSp.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90000 ); + aPropOptSp.CreateTextProperties( mXPropSet, mnTxId += 0x60, false, true ); + aPropOptSp.AddOpt( ESCHER_Prop_WrapText, ESCHER_WrapSquare ); - SvMemoryStream aClientTextBox( 0x200, 0x200 ); - SvMemoryStream aExtBu( 0x200, 0x200 ); + SvMemoryStream aClientTextBox( 0x200, 0x200 ); + SvMemoryStream aExtBu( 0x200, 0x200 ); - ImplWriteTextStyleAtom( aClientTextBox, EPP_TEXTTYPE_Other, 0, NULL, aExtBu, &aPropOptSp ); + ImplWriteTextStyleAtom( aClientTextBox, EPP_TEXTTYPE_Other, 0, NULL, aExtBu, &aPropOptSp ); - // need write client data for extend bullet - if ( aExtBu.Tell() ) - { - SvMemoryStream* pClientData = new SvMemoryStream( 0x200, 0x200 ); - ImplProgTagContainer( pClientData, &aExtBu ); - mpStrm->WriteUInt32( ( ( ESCHER_ClientData << 16 ) | 0xf ) ) - .WriteUInt32( pClientData->Tell() ); + // need write client data for extend bullet + if ( aExtBu.Tell() ) + { + SvMemoryStream* pClientData = new SvMemoryStream( 0x200, 0x200 ); + ImplProgTagContainer( pClientData, &aExtBu ); + mpStrm->WriteUInt32( ( ( ESCHER_ClientData << 16 ) | 0xf ) ) + .WriteUInt32( pClientData->Tell() ); - mpStrm->Write( pClientData->GetData(), pClientData->Tell() ); - delete pClientData, pClientData = NULL; - } + mpStrm->Write( pClientData->GetData(), pClientData->Tell() ); + delete pClientData, pClientData = NULL; + } - aPropOptSp.Commit( *mpStrm ); - mpPptEscherEx->AddAtom( 16, ESCHER_ChildAnchor ); - mpStrm ->WriteInt32( nLeft ) - .WriteInt32( nTop ) - .WriteInt32( nRight ) - .WriteInt32( nBottom ); + aPropOptSp.Commit( *mpStrm ); + mpPptEscherEx->AddAtom( 16, ESCHER_ChildAnchor ); + mpStrm ->WriteInt32( nLeft ) + .WriteInt32( nTop ) + .WriteInt32( nRight ) + .WriteInt32( nBottom ); - mpStrm->WriteUInt32( ( ( ESCHER_ClientTextbox << 16 ) | 0xf ) ) - .WriteUInt32( aClientTextBox.Tell() ); + mpStrm->WriteUInt32( ( ( ESCHER_ClientTextbox << 16 ) | 0xf ) ) + .WriteUInt32( aClientTextBox.Tell() ); - mpStrm->Write( aClientTextBox.GetData(), aClientTextBox.Tell() ); - mpPptEscherEx->CloseContainer(); - } + mpStrm->Write( aClientTextBox.GetData(), aClientTextBox.Tell() ); + xCellContainer.reset(); } } + } - static const char sTopBorder[] = "TopBorder"; - static const char sBottomBorder[] = "BottomBorder"; - static const char sLeftBorder[] = "LeftBorder"; - static const char sRightBorder[] = "RightBorder"; + static const char sTopBorder[] = "TopBorder"; + static const char sBottomBorder[] = "BottomBorder"; + static const char sLeftBorder[] = "LeftBorder"; + static const char sRightBorder[] = "RightBorder"; - // creating horz lines - for( sal_Int32 nLine = 0; nLine < ( xRows->getCount() + 1 ); nLine++ ) + // creating horz lines + for( sal_Int32 nLine = 0; nLine < ( xRows->getCount() + 1 ); nLine++ ) + { + for( sal_Int32 nColumn = 0; nColumn < xColumns->getCount(); nColumn++ ) { - for( sal_Int32 nColumn = 0; nColumn < xColumns->getCount(); nColumn++ ) - { - CellBorder aCellBorder; - aCellBorder.mnPos = aColumns[ nColumn ].first; - aCellBorder.mnLength = aColumns[ nColumn ].second; - bool bTop = false; - //write nLine*nColumn cell's top border - if ( nLine < xRows->getCount() ) - { // top border - uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nLine ), uno::UNO_QUERY_THROW ); - if ( !xCell->isMerged() ) - { - uno::Reference< beans::XPropertySet > xPropSet2( xCell, uno::UNO_QUERY_THROW ); - table::BorderLine aBorderLine; - if ( xPropSet2->getPropertyValue( sTopBorder ) >>= aBorderLine ) - aCellBorder.maCellBorder = aBorderLine; - sal_Int32 nRight = GetCellRight( nColumn, maRect,aColumns,xCell ); - bTop = ImplCreateCellBorder( &aCellBorder, aCellBorder.mnPos, - aRows[ nLine ].first, nRight, aRows[ nLine ].first ); - } + CellBorder aCellBorder; + aCellBorder.mnPos = aColumns[ nColumn ].first; + aCellBorder.mnLength = aColumns[ nColumn ].second; + bool bTop = false; + //write nLine*nColumn cell's top border + if ( nLine < xRows->getCount() ) + { // top border + uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nLine ), uno::UNO_QUERY_THROW ); + if ( !xCell->isMerged() ) + { + uno::Reference< beans::XPropertySet > xPropSet2( xCell, uno::UNO_QUERY_THROW ); + table::BorderLine aBorderLine; + if ( xPropSet2->getPropertyValue( sTopBorder ) >>= aBorderLine ) + aCellBorder.maCellBorder = aBorderLine; + sal_Int32 nRight = GetCellRight( nColumn, maRect,aColumns,xCell ); + bTop = ImplCreateCellBorder( &aCellBorder, aCellBorder.mnPos, + aRows[ nLine ].first, nRight, aRows[ nLine ].first ); } + } - //if nLine*nColumn cell's top border is empty, check (nLine-1)*nColumn cell's bottom border - //and write the last row's bottom border - if (( nLine && !bTop ) || (nLine == xRows->getCount())) - { // bottom border - sal_Int32 nRow = nLine; + //if nLine*nColumn cell's top border is empty, check (nLine-1)*nColumn cell's bottom border + //and write the last row's bottom border + if (( nLine && !bTop ) || (nLine == xRows->getCount())) + { // bottom border + sal_Int32 nRow = nLine; - while( nRow ) - { //find last no merged cell - uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nRow - 1 ), uno::UNO_QUERY_THROW ); - if ( !xCell->isMerged() ) + while( nRow ) + { //find last no merged cell + uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nRow - 1 ), uno::UNO_QUERY_THROW ); + if ( !xCell->isMerged() ) + { + sal_Int32 nRight = GetCellRight( nColumn, maRect,aColumns,xCell ); + sal_Int32 nBottom = GetCellBottom( nRow - 1, maRect,aRows,xCell ); + if ( nBottom == ( aRows[ nLine-1 ].first + aRows[ nLine-1 ].second ) ) { - sal_Int32 nRight = GetCellRight( nColumn, maRect,aColumns,xCell ); - sal_Int32 nBottom = GetCellBottom( nRow - 1, maRect,aRows,xCell ); - if ( nBottom == ( aRows[ nLine-1 ].first + aRows[ nLine-1 ].second ) ) - { - uno::Reference< table::XMergeableCell > xCellOwn( xCellRange->getCellByPosition( nColumn, nRow - 1 ), uno::UNO_QUERY_THROW ); - uno::Reference< beans::XPropertySet > xPropSet2( xCellOwn, uno::UNO_QUERY_THROW ); - table::BorderLine aBorderLine; - if ( xPropSet2->getPropertyValue( sBottomBorder ) >>= aBorderLine ) - aCellBorder.maCellBorder = aBorderLine; - ImplCreateCellBorder( &aCellBorder, aCellBorder.mnPos, - nBottom, nRight, nBottom); - } - nRow=0; + uno::Reference< table::XMergeableCell > xCellOwn( xCellRange->getCellByPosition( nColumn, nRow - 1 ), uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xPropSet2( xCellOwn, uno::UNO_QUERY_THROW ); + table::BorderLine aBorderLine; + if ( xPropSet2->getPropertyValue( sBottomBorder ) >>= aBorderLine ) + aCellBorder.maCellBorder = aBorderLine; + ImplCreateCellBorder( &aCellBorder, aCellBorder.mnPos, + nBottom, nRight, nBottom); } - else - nRow--; + nRow=0; } + else + nRow--; } } } + } - // creating vertical lines - for( sal_Int32 nLine = 0; nLine < ( xColumns->getCount() + 1 ); nLine++ ) + // creating vertical lines + for( sal_Int32 nLine = 0; nLine < ( xColumns->getCount() + 1 ); nLine++ ) + { + for( sal_Int32 nRow = 0; nRow < xRows->getCount(); nRow++ ) { - for( sal_Int32 nRow = 0; nRow < xRows->getCount(); nRow++ ) - { - CellBorder aCellBorder; - aCellBorder.mnPos = aRows[ nRow].first; - aCellBorder.mnLength = aRows[ nRow].second; - bool bLeft = false; - if ( nLine < xColumns->getCount() ) - { // left border - uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nLine, nRow ), uno::UNO_QUERY_THROW ); - if (!xCell->isMerged() ) - { - uno::Reference< beans::XPropertySet > xCellSet( xCell, uno::UNO_QUERY_THROW ); - table::BorderLine aBorderLine; - if ( xCellSet->getPropertyValue( sLeftBorder ) >>= aBorderLine ) - aCellBorder.maCellBorder = aBorderLine; - sal_Int32 nBottom = GetCellBottom( nRow, maRect, aRows,xCell ); - bLeft = ImplCreateCellBorder( &aCellBorder, aColumns[nLine].first, aCellBorder.mnPos, - aColumns[nLine].first, nBottom ); - } + CellBorder aCellBorder; + aCellBorder.mnPos = aRows[ nRow].first; + aCellBorder.mnLength = aRows[ nRow].second; + bool bLeft = false; + if ( nLine < xColumns->getCount() ) + { // left border + uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nLine, nRow ), uno::UNO_QUERY_THROW ); + if (!xCell->isMerged() ) + { + uno::Reference< beans::XPropertySet > xCellSet( xCell, uno::UNO_QUERY_THROW ); + table::BorderLine aBorderLine; + if ( xCellSet->getPropertyValue( sLeftBorder ) >>= aBorderLine ) + aCellBorder.maCellBorder = aBorderLine; + sal_Int32 nBottom = GetCellBottom( nRow, maRect, aRows,xCell ); + bLeft = ImplCreateCellBorder( &aCellBorder, aColumns[nLine].first, aCellBorder.mnPos, + aColumns[nLine].first, nBottom ); } - if ( ( nLine && !bLeft )||(nLine == xColumns->getCount())) - { // right border - sal_Int32 nColumn = nLine; - while ( nColumn ) + } + if ( ( nLine && !bLeft )||(nLine == xColumns->getCount())) + { // right border + sal_Int32 nColumn = nLine; + while ( nColumn ) + { + uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn - 1, nRow ), uno::UNO_QUERY_THROW ); + if (!xCell->isMerged() ) { - uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn - 1, nRow ), uno::UNO_QUERY_THROW ); - if (!xCell->isMerged() ) + sal_Int32 nRight = GetCellRight( nColumn-1, maRect, aColumns,xCell ); + sal_Int32 nBottom = GetCellBottom( nRow, maRect, aRows, xCell ); + if ( nRight == (aColumns[nLine-1].first + aColumns[nLine-1].second) ) { - sal_Int32 nRight = GetCellRight( nColumn-1, maRect, aColumns,xCell ); - sal_Int32 nBottom = GetCellBottom( nRow, maRect, aRows, xCell ); - if ( nRight == (aColumns[nLine-1].first + aColumns[nLine-1].second) ) - { - uno::Reference< table::XMergeableCell > xCellOwn( xCellRange->getCellByPosition( nColumn - 1, nRow ), uno::UNO_QUERY_THROW ); - uno::Reference< beans::XPropertySet > xCellSet( xCellOwn, uno::UNO_QUERY_THROW ); - table::BorderLine aBorderLine; - if ( xCellSet->getPropertyValue( sRightBorder ) >>= aBorderLine ) - aCellBorder.maCellBorder = aBorderLine; - ImplCreateCellBorder( &aCellBorder, nRight, aCellBorder.mnPos, - nRight, nBottom ); - } - nColumn = 0; + uno::Reference< table::XMergeableCell > xCellOwn( xCellRange->getCellByPosition( nColumn - 1, nRow ), uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xCellSet( xCellOwn, uno::UNO_QUERY_THROW ); + table::BorderLine aBorderLine; + if ( xCellSet->getPropertyValue( sRightBorder ) >>= aBorderLine ) + aCellBorder.maCellBorder = aBorderLine; + ImplCreateCellBorder( &aCellBorder, nRight, aCellBorder.mnPos, + nRight, nBottom ); } - else - nColumn --; + nColumn = 0; } + else + nColumn --; } } } } + + xSpgrContainer.reset(); //ESCHER_SpgrContainer } } catch( uno::Exception& ) { } - mpPptEscherEx->CloseContainer(); } void TextObjBinary::Write( SvStream* pStrm ) commit 217f45839d2fc25cdf589fbdd29860749cc2067b Author: Caolán McNamara <caol...@redhat.com> Date: Tue Apr 21 14:39:57 2015 +0100 Resolves: tdf#76825 styles drop down menu is too narrow fix indent Change-Id: I2628ac3fbabe9f33c41c7f3612eae608fb854ae3 (cherry picked from commit 7cf22a0a3202da296c1d1a3dafe6e1e5e1d7405d) break out text drawing bit as UserDrawEntry Change-Id: Icb1bcfb5f9f7475f67c9c001efdad2aa7e0d0834 (cherry picked from commit e29e3f47e687689c824d71718ae2ccaa4846ac51) draw all entries the same way Change-Id: I9da3c8dca4db4a02197a67e1fbedd9b525dc7768 (cherry picked from commit b28ba9dbd00da1094fcd53f6370c04b7caa99d7d) split out the code that sets up the device for each entry Change-Id: Iad426e1cb1eaac24edf1e7bb61307f29d33d8786 (cherry picked from commit e367337e58047c4c69869330b36c1f027f5ca5f0) refactor for reuse Change-Id: I46e04464376324c7e48fe0ccf7362c3a4256e3c2 (cherry picked from commit fa4c2d8a744049b7389d2020ce84bbb28d945c51) Change-Id: I3d1ba1da40990df2427f0d380a85d5e704f37038 (cherry picked from commit 856e9b5fe2293bef9c45219391aca664d4a0dd20) Reviewed-on: https://gerrit.libreoffice.org/15471 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 8216a9f7..d12b4bb 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -127,7 +127,7 @@ public: virtual ~SvxStyleBox_Impl(); void SetFamily( SfxStyleFamily eNewFamily ); - inline bool IsVisible() { return bVisible; } + bool IsVisible() const { return bVisible; } virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE; virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE; @@ -136,10 +136,12 @@ public: virtual void UserDraw( const UserDrawEvent& rUDEvt ) SAL_OVERRIDE; - inline void SetVisibilityListener( const Link& aVisListener ) { aVisibilityListener = aVisListener; } + void SetVisibilityListener( const Link& aVisListener ) { aVisibilityListener = aVisListener; } void SetDefaultStyle( const OUString& rDefault ) { sDefaultStyle = rDefault; } + void CalcOptimalExtraUserWidth(); + protected: virtual void Select() SAL_OVERRIDE; @@ -162,6 +164,9 @@ private: void ReleaseFocus(); Color TestColorsVisible(const Color &FontCol, const Color &BackCol); + void UserDrawEntry(const UserDrawEvent& rUDEvt, const OUString &rStyleName); + void SetupEntry(sal_uInt16 nItem, const Rectangle& rRect, OutputDevice *pDevice, const OUString &rStyleName, bool bIsNotSelected); + bool AdjustFontForItemHeight(OutputDevice* pDevice, Rectangle& rTextRect, long nHeight); DECL_LINK( MenuSelectHdl, Menu * ); }; @@ -299,6 +304,9 @@ class SfxStyleControllerItem_Impl : public SfxStatusListener SvxStyleToolBoxControl& rControl; }; +#define BUTTON_WIDTH 20 +#define ITEM_HEIGHT 30 + SvxStyleBox_Impl::SvxStyleBox_Impl(vcl::Window* pParent, const OUString& rCommand, SfxStyleFamily eFamily, @@ -326,7 +334,7 @@ SvxStyleBox_Impl::SvxStyleBox_Impl(vcl::Window* pParent, aLogicalSize = PixelToLogic( GetSizePixel(), MAP_APPFONT ); EnableAutocomplete( true ); EnableUserDraw( true ); - SetUserItemSize( Size( 0, 30 ) ); + SetUserItemSize( Size( 0, ITEM_HEIGHT ) ); } SvxStyleBox_Impl::~SvxStyleBox_Impl() @@ -550,18 +558,51 @@ void SvxStyleBox_Impl::StateChanged( StateChangedType nStateChange ) } } -void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) +bool SvxStyleBox_Impl::AdjustFontForItemHeight(OutputDevice* pDevice, Rectangle& rTextRect, long nHeight) { - sal_uInt16 nItem = rUDEvt.GetItemId(); + if (rTextRect.Bottom() > nHeight) + { + // the text does not fit, adjust the font size + double ratio = static_cast< double >( nHeight ) / rTextRect.Bottom(); + vcl::Font aFont(pDevice->GetFont()); + Size aPixelSize(aFont.GetSize()); + aPixelSize.Width() *= ratio; + aPixelSize.Height() *= ratio; + aFont.SetSize(aPixelSize); + pDevice->SetFont(aFont); + return true; + } + return false; +} + +void SvxStyleBox_Impl::UserDrawEntry(const UserDrawEvent& rUDEvt, const OUString &rStyleName) +{ + OutputDevice *pDevice = rUDEvt.GetDevice(); + + // IMG_TXT_DISTANCE in ilstbox.hxx is 6, then 1 is added as + // nBorder, and we are adding 1 in order to look better when + // italics is present + const int nLeftDistance = 8; + + Rectangle aTextRect; + pDevice->GetTextBoundRect(aTextRect, rStyleName); + + Point aPos( rUDEvt.GetRect().TopLeft() ); + aPos.X() += nLeftDistance; + + if (!AdjustFontForItemHeight(pDevice, aTextRect, rUDEvt.GetRect().GetHeight())) + aPos.Y() += ( rUDEvt.GetRect().GetHeight() - aTextRect.Bottom() ) / 2; - if ( nItem == 0 || nItem == GetEntryCount() - 1 ) + pDevice->DrawText(aPos, rStyleName); +} + +void SvxStyleBox_Impl::SetupEntry(sal_uInt16 nItem, const Rectangle& rRect, OutputDevice* pDevice, const OUString& rStyleName, bool bIsNotSelected) +{ + if (nItem == 0 || nItem == GetEntryCount() - 1) { - Rectangle aRect(rUDEvt.GetRect()); - unsigned int nId = (aRect.getY() / aRect.GetSize().Height()); + unsigned int nId = (rRect.getY() / rRect.GetSize().Height()); if(nId < MAX_STYLES_ENTRIES && m_pButtons[nId]) m_pButtons[nId]->Hide(); - // draw the non-style entries, ie. "Clear Formatting" or "More..." - DrawEntry( rUDEvt, true, true ); } else { @@ -569,23 +610,16 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) SfxStyleSheetBasePool* pPool = pShell->GetStyleSheetPool(); SfxStyleSheetBase* pStyle = NULL; - OUString aStyleName( GetEntry( nItem ) ); - if ( pPool ) { pPool->SetSearchMask( eStyleFamily, SFXSTYLEBIT_ALL ); pStyle = pPool->First(); - while ( pStyle && OUString( pStyle->GetName() ) != aStyleName ) + while (pStyle && pStyle->GetName() != rStyleName) pStyle = pPool->Next(); } - if ( !pStyle ) - { - // cannot find the style for whatever reason - DrawEntry( rUDEvt, true, true ); - } - else + if (pStyle ) { const SfxItemSet& aItemSet = pStyle->GetItemSet(); @@ -594,8 +628,6 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) if ( pFontItem && pFontHeightItem ) { - OutputDevice *pDevice = rUDEvt.GetDevice(); - Size aFontSize( 0, pFontHeightItem->GetHeight() ); Size aPixelSize( pDevice->LogicToPixel( aFontSize, pShell->GetMapUnit() ) ); @@ -647,25 +679,21 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) // setup the device & draw vcl::Font aOldFont( pDevice->GetFont() ); - Color aOldColor( pDevice->GetTextColor() ); - Color aOldFillColor( pDevice->GetFillColor() ); Color aFontCol = COL_AUTO, aBackCol = COL_AUTO; pDevice->SetFont( aFont ); - bool IsNotSelected = rUDEvt.GetItemId() != GetSelectEntryPos(); - pItem = aItemSet.GetItem( SID_ATTR_CHAR_COLOR ); // text color, when nothing is selected - if ( (NULL != pItem) && IsNotSelected) + if ( (NULL != pItem) && bIsNotSelected) aFontCol = Color( static_cast< const SvxColorItem* >( pItem )->GetValue() ); sal_uInt16 style = drawing::FillStyle_NONE; // which kind of Fill style is selected pItem = aItemSet.GetItem( XATTR_FILLSTYLE ); // only when ok and not selected - if ( (NULL != pItem) && IsNotSelected) + if ( (NULL != pItem) && bIsNotSelected) style = static_cast< const XFillStyleItem* >( pItem )->GetValue(); switch(style) @@ -680,13 +708,13 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) if ( aBackCol != COL_AUTO ) { pDevice->SetFillColor( aBackCol ); - pDevice->DrawRect( rUDEvt.GetRect() ); + pDevice->DrawRect(rRect); } } break; //TODO Draw the other background styles: gradient, hatching and bitmap - } + } // when the font and background color are too similar, adjust the Font-Color if( (aFontCol != COL_AUTO) || (aBackCol != COL_AUTO) ) @@ -697,65 +725,89 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) pDevice->SetTextColor( aFontCol ); // handle the push-button - if (IsNotSelected) + if (bIsNotSelected) { - Rectangle aRect(rUDEvt.GetRect()); - unsigned int nId = (aRect.getY() / aRect.GetSize().Height()); + unsigned int nId = (rRect.getY() / rRect.GetSize().Height()); if(nId < MAX_STYLES_ENTRIES && m_pButtons[nId]) m_pButtons[nId]->Hide(); } else { - Rectangle aRect(rUDEvt.GetRect()); - unsigned int nId = (aRect.getY() / aRect.GetSize().Height()); + unsigned int nId = (rRect.getY() / rRect.GetSize().Height()); if(nId < MAX_STYLES_ENTRIES) { if(m_pButtons[nId] == NULL) { m_pButtons[nId] = new MenuButton(static_cast<vcl::Window*>(pDevice), WB_FLATBUTTON | WB_NOPOINTERFOCUS); - m_pButtons[nId]->SetSizePixel(Size(20, aRect.GetSize().Height())); + m_pButtons[nId]->SetSizePixel(Size(BUTTON_WIDTH, rRect.GetSize().Height())); m_pButtons[nId]->SetPopupMenu(&m_aMenu); } - m_pButtons[nId]->SetPosPixel(Point(aRect.GetWidth() - 20, aRect.getY())); + m_pButtons[nId]->SetPosPixel(Point(rRect.GetWidth() - BUTTON_WIDTH, rRect.getY())); m_pButtons[nId]->Show(); } } + } + } + } +} - // IMG_TXT_DISTANCE in ilstbox.hxx is 6, then 1 is added as - // nBorder, and we are adding 1 in order to look better when - // italics is present - const int nLeftDistance = 8; +void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) +{ + sal_uInt16 nItem = rUDEvt.GetItemId(); + OUString aStyleName( GetEntry( nItem ) ); - Rectangle aTextRect; - pDevice->GetTextBoundRect( aTextRect, aStyleName ); + OutputDevice *pDevice = rUDEvt.GetDevice(); + pDevice->Push(PushFlags::FILLCOLOR | PushFlags::FONT | PushFlags::TEXTCOLOR); - Point aPos( rUDEvt.GetRect().TopLeft() ); - aPos.X() += nLeftDistance; - if ( aTextRect.Bottom() > rUDEvt.GetRect().GetHeight() ) - { - // the text does not fit, adjust the font size - double ratio = static_cast< double >( rUDEvt.GetRect().GetHeight() ) / aTextRect.Bottom(); - aPixelSize.Width() *= ratio; - aPixelSize.Height() *= ratio; - aFont.SetSize( aPixelSize ); - pDevice->SetFont( aFont ); - } - else - aPos.Y() += ( rUDEvt.GetRect().GetHeight() - aTextRect.Bottom() ) / 2; + const Rectangle& rRect(rUDEvt.GetRect()); + bool bIsNotSelected = rUDEvt.GetItemId() != GetSelectEntryPos(); - pDevice->DrawText( aPos, aStyleName ); + SetupEntry(nItem, rRect, pDevice, aStyleName, bIsNotSelected); - pDevice->SetFillColor( aOldFillColor ); - pDevice->SetTextColor( aOldColor ); - pDevice->SetFont( aOldFont ); + UserDrawEntry(rUDEvt, aStyleName); - // draw separator, if present - DrawEntry( rUDEvt, false, false ); - } - else - DrawEntry( rUDEvt, true, true ); + pDevice->Pop(); + // draw separator, if present + DrawEntry( rUDEvt, false, false ); +} + +void SvxStyleBox_Impl::CalcOptimalExtraUserWidth() +{ + long nMaxNormalFontWidth = 0; + sal_Int32 nEntryCount = GetEntryCount(); + for (sal_Int32 i = 0; i < nEntryCount; ++i) + { + OUString sStyleName(GetEntry(i)); + Rectangle aTextRectForDefaultFont; + GetTextBoundRect(aTextRectForDefaultFont, sStyleName); + + const long nWidth = aTextRectForDefaultFont.GetWidth(); + + nMaxNormalFontWidth = std::max(nWidth, nMaxNormalFontWidth); + } + + long nMaxUserDrawFontWidth = nMaxNormalFontWidth; + for (sal_Int32 i = 1; i < nEntryCount-1; ++i) + { + OUString sStyleName(GetEntry(i)); + + Push(PushFlags::FILLCOLOR | PushFlags::FONT | PushFlags::TEXTCOLOR); + SetupEntry(i, Rectangle(0, 0, RECT_MAX, ITEM_HEIGHT), this, sStyleName, false); + Rectangle aTextRectForActualFont; + GetTextBoundRect(aTextRectForActualFont, sStyleName); + if (AdjustFontForItemHeight(this, aTextRectForActualFont, ITEM_HEIGHT)) + { + //Font didn't fit, so it was changed, refetch with final font size + GetTextBoundRect(aTextRectForActualFont, sStyleName); } + Pop(); + + const long nWidth = aTextRectForActualFont.GetWidth() + BUTTON_WIDTH; + + nMaxUserDrawFontWidth = std::max(nWidth, nMaxUserDrawFontWidth); } + + SetUserItemSize(Size(nMaxUserDrawFontWidth - nMaxNormalFontWidth, ITEM_HEIGHT)); } // test is the color between Font- and background-color to be identify @@ -2094,7 +2146,7 @@ void SvxStyleToolBoxControl::FillStyleBox() if ( pStyleSheetPool && pBox && nActFamily!=0xffff ) { const SfxStyleFamily eFamily = GetActFamily(); - sal_uInt16 nCount = pStyleSheetPool->Count(); + sal_uInt16 nCount = pStyleSheetPool->Count(); SfxStyleSheetBase* pStyle = NULL; bool bDoFill = false; @@ -2195,6 +2247,8 @@ void SvxStyleToolBoxControl::FillStyleBox() sal_uInt16 nLines = static_cast<sal_uInt16>( std::min( pBox->GetEntryCount(), static_cast<sal_Int32>(MAX_STYLES_ENTRIES))); pBox->SetDropDownLineCount( nLines ); + + pBox->CalcOptimalExtraUserWidth(); } } } commit 8b80345984ebe3980dba91aae81e39f9b12b8624 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Apr 8 20:34:35 2015 +0100 fix assert on exporting fdo79938-1.ott to .doc Change-Id: I93f331bd1c57bd016948e3ed784530724a1028b4 (cherry picked from commit 9c0788f545a9276d18060965794143179917e766) Reviewed-on: https://gerrit.libreoffice.org/15459 Reviewed-by: Michael Stahl <mst...@redhat.com> Tested-by: Michael Stahl <mst...@redhat.com> diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 95c0a80..0d7c5e2 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -2061,10 +2061,12 @@ static int lcl_CheckForm( const SwForm& rForm, sal_uInt8 nLvl, OUString& rText ) nRet = 2; break; case TOKEN_TEXT: + { nRet = 3; - rText = aIt->sText.copy( 0, 5 ); // #i21237# + sal_Int32 nCount = std::min<sal_Int32>(5, aIt->sText.getLength()); + rText = aIt->sText.copy(0, nCount); // #i21237# break; - + } case TOKEN_LINK_START: case TOKEN_LINK_END: break; commit 58c19136691a3b268733703cc8940703c7f50450 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Jan 12 16:54:45 2015 +0000 Resolves: tdf#79975 toggle checkered background back on Change-Id: Id856d8dbf437acb7e528e60b4d1b012102ff0557 (cherry picked from commit 8b2a9a37306a7febf28e419280d1782ff230761a) Reviewed-on: https://gerrit.libreoffice.org/15460 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index fc9a67b..9987641 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -6345,7 +6345,7 @@ </desc> <label>Shows previews with shining through checkered background to visualize transparency.</label> </info> - <value>false</value> + <value>true</value> </prop> </group> <group oor:name="ExternalApps" oor:extensible="true"> diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index 74d9712..daab735 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -272,7 +272,6 @@ void drawTransparenceBackground(OutputDevice& rOut, const Point& rPos, const Siz } } - GalleryIconView::GalleryIconView( GalleryBrowser2* pParent, GalleryTheme* pTheme ) : ValueSet( pParent, WB_TABSTOP | WB_3DLOOK | WB_BORDER | WB_ITEMBORDER | WB_DOUBLEBORDER | WB_VSCROLL | WB_FLATVALUESET ), DropTargetHelper( this ), commit 7f66bde147a306a242ba18a47e0bcabda6543a4c Author: Michael Stahl <mst...@redhat.com> Date: Tue Apr 21 14:03:01 2015 +0200 tdf#90640: xmloff: ODF export: fix style:background-image attributes ... for Writer frames, which were missing the draw:opacity; turns out this is because now the the default valued properties are not exported any more, which causes them to be missing in the property array so the hard-coded indexes in XMLTextExportPropertySetMapper::handleElementItem() do not find them. (regression from c3e49660e782816d1203cb936156ef6d6a1ad572) Change-Id: I84b6c09b23a2275161135290f1b0ac9f52546a80 (cherry picked from commit c13b80e202a07b374531babe3af5a8529483f060) Reviewed-on: https://gerrit.libreoffice.org/15465 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx index 5fc9cc4..46948b2 100644 --- a/xmloff/source/text/txtexppr.cxx +++ b/xmloff/source/text/txtexppr.cxx @@ -70,35 +70,36 @@ void XMLTextExportPropertySetMapper::handleElementItem( case CTF_BACKGROUND_URL: { - DBG_ASSERT( pProperties && nIdx >= 3, - "property vector missing" ); + assert(pProperties && nIdx >= 3); const Any *pPos = 0, *pFilter = 0, *pTrans = 0; - if( pProperties && nIdx >= 3 ) + sal_uInt32 nPropIndex = rProperty.mnIndex; + + // these are all optional, so have to check them in order + // note: this index order dependency is a steaming pile of manure + sal_uInt32 nIndex(nIdx - 1); + const XMLPropertyState& rFilter = (*pProperties)[nIndex]; + if (CTF_BACKGROUND_FILTER == getPropertySetMapper() + ->GetEntryContextId(rFilter.mnIndex)) { - const XMLPropertyState& rTrans = (*pProperties)[nIdx-3]; - // #99657# transparency may be there, but doesn't have to be. - // If it's there, it must be in the right position. - if( CTF_BACKGROUND_TRANSPARENCY == getPropertySetMapper() - ->GetEntryContextId( rTrans.mnIndex ) ) - pTrans = &rTrans.maValue; - - const XMLPropertyState& rPos = (*pProperties)[nIdx-2]; - DBG_ASSERT( CTF_BACKGROUND_POS == getPropertySetMapper() - ->GetEntryContextId( rPos.mnIndex ), - "invalid property map: pos expected" ); - if( CTF_BACKGROUND_POS == getPropertySetMapper() - ->GetEntryContextId( rPos.mnIndex ) ) - pPos = &rPos.maValue; - - const XMLPropertyState& rFilter = (*pProperties)[nIdx-1]; - DBG_ASSERT( CTF_BACKGROUND_FILTER == getPropertySetMapper() - ->GetEntryContextId( rFilter.mnIndex ), - "invalid property map: filter expected" ); - if( CTF_BACKGROUND_FILTER == getPropertySetMapper() - ->GetEntryContextId( rFilter.mnIndex ) ) - pFilter = &rFilter.maValue; + pFilter = &rFilter.maValue; + --nIndex; } - sal_uInt32 nPropIndex = rProperty.mnIndex; + + const XMLPropertyState& rPos = (*pProperties)[nIndex]; + if (CTF_BACKGROUND_POS == getPropertySetMapper() + ->GetEntryContextId(rPos.mnIndex)) + { + pPos = &rPos.maValue; + --nIndex; + } + + const XMLPropertyState& rTrans = (*pProperties)[nIndex]; + // #99657# transparency may be there, but doesn't have to be. + // If it's there, it must be in the right position. + if( CTF_BACKGROUND_TRANSPARENCY == getPropertySetMapper() + ->GetEntryContextId( rTrans.mnIndex ) ) + pTrans = &rTrans.maValue; + pThis->maBackgroundImageExport.exportXML( rProperty.maValue, pPos, pFilter, pTrans, getPropertySetMapper()->GetEntryNameSpace( nPropIndex ), diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index da7dc5d..0a09bdd 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -382,6 +382,7 @@ XMLPropertyMapEntry aXMLParaPropMap[] = // RES_ANCHOR // not required // RES_BACKGROUND + // DO NOT REORDER these! MP_E( "ParaBackColor", FO, BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ), MP_E( "ParaBackTransparent", FO, BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ), MP_E( "ParaBackGraphicLocation", STYLE, POSITION, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BUILDIN_CMP_ONLY, CTF_BACKGROUND_POS ), @@ -742,6 +743,7 @@ XMLPropertyMapEntry aXMLFramePropMap[] = // RES_ANCHOR // see above // RES_BACKGROUND + // DO NOT REORDER these! MG_ED( "BackColorRGB", FO, BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ), MG_ED( "BackTransparent", FO, BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, CTF_BACKGROUND_TRANSPARENT ), MG_ED( "BackColorTransparency", STYLE, BACKGROUND_TRANSPARENCY, XML_TYPE_PERCENT8, CTF_BACKGROUND_TRANSPARENCY ), @@ -922,6 +924,7 @@ XMLPropertyMapEntry aXMLSectionPropMap[] = MS_E( "TextColumns", STYLE, COLUMNS, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_COLUMNS, CTF_TEXTCOLUMNS ), // RES_BACKGROUND + // DO NOT REORDER these! MS_E( "BackColor", FO, BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ), MS_E( "BackTransparent", FO, BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ), MS_E( "BackGraphicLocation", STYLE, POSITION, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BUILDIN_CMP_ONLY, CTF_BACKGROUND_POS ), commit 284620e5f6cf9099b708a7730ff23cfeac87fd19 Author: Michael Stahl <mst...@redhat.com> Date: Tue Apr 21 00:15:55 2015 +0200 sw: ODF import: frame background: do not override gradient transparency ... with style:background-transparency (regression from 102bb87ca1a5dee3a09442bf503a54bb703c79ea) Change-Id: Icead7a47c145eace51249896b6e05d65dfaa2f78 (cherry picked from commit 3670e3c0c1bfcea9dc50fefb20b67a828b1e35bb) Reviewed-on: https://gerrit.libreoffice.org/15464 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 1bcdc23..a418203 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -455,7 +455,8 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI aXFillTransparenceItem.PutValue(*pXFillTransparenceItem); rToSet.Put(aXFillTransparenceItem); } - else if (pColTrans) + else if (pColTrans && + !pXFillFloatTransparenceItem && !pXFillFloatTransparenceNameItem) { // No fill transparency is given. On the other hand, we have a // BackColorTransparency, so use that. commit 11158a581f36ac6b954dfd590aeed40c005c17e7 Author: Michael Stahl <mst...@redhat.com> Date: Mon Apr 20 23:42:45 2015 +0200 tdf#90640: sw: ODF import: ignore style:background-transparency for ... bitmap backgrounds of frames. OOo/LO versions <= 4.3 wrongly write fo:background-color="transparent" style:background-transparency="100%" for bitmap backgrounds, because of a stupid API implementation with SvxBrushItem. They overwrite that with draw:opacity="100%" on the child element style:background-image, which we don't read if we see draw:fill attributes, so ignore the background-transparency in that case. (regression from 5aa360cae0383f270c12708e7e94179a7fde6711) Change-Id: I4ca59d8932a8e5d034c35543a54528198ad7d51c (cherry picked from commit 09f0919f9a1686f6c1492777307e77f841294192) Reviewed-on: https://gerrit.libreoffice.org/15463 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index d62fd291..1bcdc23 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -459,9 +459,15 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI { // No fill transparency is given. On the other hand, we have a // BackColorTransparency, so use that. + // tdf#90640 tdf#90130: this is necessary for LO 4.4.0 - 4.4.2 + // that forgot to write draw:opacity into documents + // but: the value was *always* wrong for bitmaps! => ignore it sal_Int8 nGraphicTransparency(0); *pColTrans >>= nGraphicTransparency; - rToSet.Put(XFillTransparenceItem(nGraphicTransparency)); + if (aXFillStyleItem.GetValue() != drawing::FillStyle_BITMAP) + { + rToSet.Put(XFillTransparenceItem(nGraphicTransparency)); + } if (aXFillStyleItem.GetValue() == drawing::FillStyle_SOLID) { aBrush.PutValue(*pColTrans, MID_BACK_COLOR_TRANSPARENCY); commit a69dcc6c5e428414d9bf1abe1650ea64d4d1deca Author: Michael Stahl <mst...@redhat.com> Date: Mon Apr 20 20:05:38 2015 +0200 tdf#90640: sw: ODF export: be consistent when exporting RES_BACKGROUND The emulation of legacy RES_BACKGROUND properties claims that (unless fillstyle is NONE) all of them are direct values, which causes export of legacy attributes like style:background-transparency without corresponding non-legacy draw:opacity. Especially problematic for style:background-transparency, which is set to 100% if style is bitmap, which is the reasonable default for API backward compatibility of BackColorTransparency, but wrong for ODF. Change-Id: I1fa4fa5df45eb00cbfcd2e171b4862c4e195cc7d (cherry picked from commit c3e49660e782816d1203cb936156ef6d6a1ad572) Reviewed-on: https://gerrit.libreoffice.org/15462 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/sw/inc/swunohelper.hxx b/sw/inc/swunohelper.hxx index 6ebc335..c00404c 100644 --- a/sw/inc/swunohelper.hxx +++ b/sw/inc/swunohelper.hxx @@ -77,7 +77,7 @@ bool UCB_IsDirectory( const OUString& rURL ); ///UUUU helper to check if fill style is set to color or bitmap /// and thus formally used SvxBrushItem parts need to be mapped /// for backwards compatibility -bool needToMapFillItemsToSvxBrushItemTypes(const SfxItemSet& rSet); +bool needToMapFillItemsToSvxBrushItemTypes(const SfxItemSet& rSet, sal_uInt16 const nMemberId); } diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx index 8a1bd2a..45af6f3 100644 --- a/sw/source/core/unocore/swunohelper.cxx +++ b/sw/source/core/unocore/swunohelper.cxx @@ -39,6 +39,7 @@ //UUUU #include <svx/xfillit0.hxx> +#include <editeng/memberids.hrc> #include <svl/itemset.hxx> using namespace com::sun::star; @@ -268,7 +269,8 @@ bool UCB_GetFileListOfFolder( const OUString& rURL, } //UUUU -bool needToMapFillItemsToSvxBrushItemTypes(const SfxItemSet& rSet) +bool needToMapFillItemsToSvxBrushItemTypes(const SfxItemSet& rSet, + sal_uInt16 const nMID) { const XFillStyleItem* pXFillStyleItem(static_cast< const XFillStyleItem* >(rSet.GetItem(XATTR_FILLSTYLE, false))); @@ -280,17 +282,50 @@ bool needToMapFillItemsToSvxBrushItemTypes(const SfxItemSet& rSet) // here different FillStyles can be excluded for export; it will depend on the // quality these fallbacks can reach. That again is done in getSvxBrushItemFromSourceSet, // take a look there how the superset of DrawObject FillStyles is mapped to SvxBrushItem. - // For now, take them all - except drawing::FillStyle_NONE - - if(drawing::FillStyle_NONE != pXFillStyleItem->GetValue()) + switch (pXFillStyleItem->GetValue()) { - return true; + case drawing::FillStyle_NONE: + return false; // ignoring some extremely limited XFillColorItem eval + break; + case drawing::FillStyle_SOLID: + case drawing::FillStyle_GRADIENT: // gradient and hatch don't exist in + case drawing::FillStyle_HATCH: // SvxBrushItem so average color is emulated + switch (nMID) + { + case MID_BACK_COLOR: + // Gradient/Hatch always have emulated color + return (drawing::FillStyle_SOLID != nMID) + || SfxItemState::SET == rSet.GetItemState(XATTR_FILLCOLOR) + || SfxItemState::SET == rSet.GetItemState(XATTR_FILLTRANSPARENCE) + || SfxItemState::SET == rSet.GetItemState(XATTR_FILLFLOATTRANSPARENCE); + case MID_BACK_COLOR_R_G_B: + // Gradient/Hatch always have emulated color + return (drawing::FillStyle_SOLID != nMID) + || SfxItemState::SET == rSet.GetItemState(XATTR_FILLCOLOR); + case MID_BACK_COLOR_TRANSPARENCY: + return SfxItemState::SET == rSet.GetItemState(XATTR_FILLTRANSPARENCE) + || SfxItemState::SET == rSet.GetItemState(XATTR_FILLFLOATTRANSPARENCE); + } + break; + case drawing::FillStyle_BITMAP: + switch (nMID) + { + case MID_GRAPHIC_URL: + return SfxItemState::SET == rSet.GetItemState(XATTR_FILLBITMAP); + case MID_GRAPHIC_POSITION: + return SfxItemState::SET == rSet.GetItemState(XATTR_FILLBMP_STRETCH) + || SfxItemState::SET == rSet.GetItemState(XATTR_FILLBMP_TILE) + || SfxItemState::SET == rSet.GetItemState(XATTR_FILLBMP_POS); + case MID_GRAPHIC_TRANSPARENT: + case MID_GRAPHIC_TRANSPARENCY: + return SfxItemState::SET == rSet.GetItemState(XATTR_FILLTRANSPARENCE) + || SfxItemState::SET == rSet.GetItemState(XATTR_FILLFLOATTRANSPARENCE); + } + break; + default: + assert(false); } - // if(XFILL_SOLID == pXFillStyleItem->GetValue() || XFILL_BITMAP == pXFillStyleItem->GetValue()) - // { - // return true; - // } return false; } diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 7cd950e..d62fd291 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2409,13 +2409,16 @@ uno::Sequence< beans::PropertyState > SwXFrame::getPropertyStates( pStates[i] = beans::PropertyState_AMBIGUOUS_VALUE; } } - //UUUU for FlyFrames we need to mark all properties from type RES_BACKGROUND + //UUUU for FlyFrames we need to mark the used properties from type RES_BACKGROUND // as beans::PropertyState_DIRECT_VALUE to let users of this property call // getPropertyValue where the member properties will be mapped from the // fill attributes to the according SvxBrushItem entries - else if(RES_BACKGROUND == pEntry->nWID && SWUnoHelper::needToMapFillItemsToSvxBrushItemTypes(rFmtSet)) + else if (RES_BACKGROUND == pEntry->nWID) { - pStates[i] = beans::PropertyState_DIRECT_VALUE; + if (SWUnoHelper::needToMapFillItemsToSvxBrushItemTypes(rFmtSet, pEntry->nMemberId)) + pStates[i] = beans::PropertyState_DIRECT_VALUE; + else + pStates[i] = beans::PropertyState_DEFAULT_VALUE; } else { diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 3acacd7..8479ef0 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -1031,11 +1031,12 @@ static beans::PropertyState lcl_SwXParagraph_getPropertyState( { if(*ppSet) { - if(SWUnoHelper::needToMapFillItemsToSvxBrushItemTypes(**ppSet)) + if (SWUnoHelper::needToMapFillItemsToSvxBrushItemTypes(**ppSet, + rEntry.nMemberId)) { eRet = beans::PropertyState_DIRECT_VALUE; - bDone = true; } + bDone = true; } break; } diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 57ab928..2329c74 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -2919,14 +2919,20 @@ uno::Sequence< beans::PropertyState > SwXStyle::getPropertyStates( bDone = true; } - //UUUU for FlyFrames we need to mark all properties from type RES_BACKGROUND + //UUUU for FlyFrames we need to mark the used properties from type RES_BACKGROUND // as beans::PropertyState_DIRECT_VALUE to let users of this property call // getPropertyValue where the member properties will be mapped from the // fill attributes to the according SvxBrushItem entries - if(!bDone && RES_BACKGROUND == pEntry->nWID - && SWUnoHelper::needToMapFillItemsToSvxBrushItemTypes(*pSourceSet)) + if (!bDone && RES_BACKGROUND == pEntry->nWID) { - pStates[i] = beans::PropertyState_DIRECT_VALUE; + if (SWUnoHelper::needToMapFillItemsToSvxBrushItemTypes(*pSourceSet, pEntry->nMemberId)) + { + pStates[i] = beans::PropertyState_DIRECT_VALUE; + } + else + { + pStates[i] = beans::PropertyState_DEFAULT_VALUE; + } bDone = true; } @@ -4873,11 +4879,16 @@ uno::Sequence< beans::PropertyState > SwXAutoStyle::getPropertyStates( } case RES_BACKGROUND: { - if(SWUnoHelper::needToMapFillItemsToSvxBrushItemTypes(*mpSet)) + if (SWUnoHelper::needToMapFillItemsToSvxBrushItemTypes(*mpSet, + pEntry->nMemberId)) { pStates[i] = beans::PropertyState_DIRECT_VALUE; - bDone = true; } + else + { + pStates[i] = beans::PropertyState_DEFAULT_VALUE; + } + bDone = true; break; } commit 21a3d44e1cc4da29882d2d84d29e7a384c4b066e Author: Michael Stahl <mst...@redhat.com> Date: Mon Apr 20 17:19:02 2015 +0200 tdf#90640: sw: ODF export: fix wrong property types in FILL_PROPERTIES_SW Wrong type causes draw:opacity not to be exported from FillTransparence. (regression from 6e61ecd09679a66060f932835622821d39e92f01) Change-Id: I478fc34dfb614f0433a6e28b0260379528b86680 (cherry picked from commit 822cb231c9aee2b69d0e645d2fddbab1dfbe3d14) Reviewed-on: https://gerrit.libreoffice.org/15461 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index 540f4b5..c59cf80 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -569,7 +569,7 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider() //UUUU #define FILL_PROPERTIES_SW_BMP \ - { OUString(UNO_NAME_SW_FILLBMP_LOGICAL_SIZE), XATTR_FILLBMP_SIZELOG, cppu::UnoType<float>::get(), 0, 0}, \ + { OUString(UNO_NAME_SW_FILLBMP_LOGICAL_SIZE), XATTR_FILLBMP_SIZELOG, cppu::UnoType<bool>::get(), 0, 0}, \ { OUString(UNO_NAME_SW_FILLBMP_OFFSET_X), XATTR_FILLBMP_TILEOFFSETX, cppu::UnoType<sal_Int32>::get(), 0, 0}, \ { OUString(UNO_NAME_SW_FILLBMP_OFFSET_Y), XATTR_FILLBMP_TILEOFFSETY, cppu::UnoType<sal_Int32>::get(), 0, 0}, \ { OUString(UNO_NAME_SW_FILLBMP_POSITION_OFFSET_X), XATTR_FILLBMP_POSOFFSETX, cppu::UnoType<sal_Int32>::get(), 0, 0}, \ @@ -577,8 +577,8 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider() { OUString(UNO_NAME_SW_FILLBMP_RECTANGLE_POINT), XATTR_FILLBMP_POS, cppu::UnoType<css::drawing::RectanglePoint>::get(), 0, 0}, \ { OUString(UNO_NAME_SW_FILLBMP_SIZE_X), XATTR_FILLBMP_SIZEX, cppu::UnoType<sal_Int32>::get(), 0, SFX_METRIC_ITEM}, \ { OUString(UNO_NAME_SW_FILLBMP_SIZE_Y), XATTR_FILLBMP_SIZEY, cppu::UnoType<sal_Int32>::get(), 0, SFX_METRIC_ITEM}, \ - { OUString(UNO_NAME_SW_FILLBMP_STRETCH), XATTR_FILLBMP_STRETCH, cppu::UnoType<float>::get(), 0, 0}, \ - { OUString(UNO_NAME_SW_FILLBMP_TILE), XATTR_FILLBMP_TILE, cppu::UnoType<float>::get(), 0, 0},\ + { OUString(UNO_NAME_SW_FILLBMP_STRETCH), XATTR_FILLBMP_STRETCH, cppu::UnoType<bool>::get(), 0, 0}, \ + { OUString(UNO_NAME_SW_FILLBMP_TILE), XATTR_FILLBMP_TILE, cppu::UnoType<bool>::get(), 0, 0},\ { OUString(UNO_NAME_SW_FILLBMP_MODE), OWN_ATTR_FILLBMP_MODE, cppu::UnoType<drawing::BitmapMode>::get(), 0, 0}, \ //UUUU @@ -599,7 +599,7 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider() { OUString(UNO_NAME_SW_FILLHATCH), XATTR_FILLHATCH, cppu::UnoType<css::drawing::Hatch>::get(), 0, MID_FILLHATCH}, \ { OUString(UNO_NAME_SW_FILLHATCHNAME), XATTR_FILLHATCH, cppu::UnoType<OUString>::get(), 0, MID_NAME }, \ { OUString(UNO_NAME_SW_FILLSTYLE), XATTR_FILLSTYLE, cppu::UnoType<css::drawing::FillStyle>::get(), 0, 0}, \ - { OUString(UNO_NAME_SW_FILL_TRANSPARENCE), XATTR_FILLTRANSPARENCE, cppu::UnoType<sal_Int32>::get(), 0, 0}, \ + { OUString(UNO_NAME_SW_FILL_TRANSPARENCE), XATTR_FILLTRANSPARENCE, cppu::UnoType<sal_Int16>::get(), 0, 0}, \ { OUString(UNO_NAME_SW_FILLTRANSPARENCEGRADIENT), XATTR_FILLFLOATTRANSPARENCE, cppu::UnoType<css::awt::Gradient>::get(), 0, MID_FILLGRADIENT}, \ { OUString(UNO_NAME_SW_FILLTRANSPARENCEGRADIENTNAME), XATTR_FILLFLOATTRANSPARENCE, cppu::UnoType<OUString>::get(), 0, MID_NAME }, \ { OUString(UNO_NAME_SW_FILLCOLOR_2), XATTR_SECONDARYFILLCOLOR, cppu::UnoType<sal_Int32>::get(), 0, 0}, \ commit 41a395ca1ae103ad659456031fb729af73a00483 Author: Eike Rathke <er...@redhat.com> Date: Tue Apr 14 23:09:46 2015 +0200 tdf#89957 prevent crash, not really fixed See source code comment. (cherry picked from commit cff5ee864b2d87d74079697425d7895dbf1b2ba4) more SAL_INFO sc.core.grouparealistener (cherry picked from commit b03563571fb922636635ea72f2dbda18d736ff89) Conflicts: sc/source/core/tool/grouparealistener.cxx a3c75e626edee3ad28ad5b7eb80f729ae8aaa83f Change-Id: I3ab7ab6aec1d782de0733064fea031c895f28965 Reviewed-on: https://gerrit.libreoffice.org/15331 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 1c79f11..bacafa5 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -351,7 +351,7 @@ public: void GetFormula( SCROW nRow, OUString& rFormula ) const; const ScFormulaCell* GetFormulaCell( SCROW nRow ) const; ScFormulaCell* GetFormulaCell( SCROW nRow ); - ScFormulaCell * const * GetFormulaCellBlockAddress( SCROW nRow ) const; + ScFormulaCell * const * GetFormulaCellBlockAddress( SCROW nRow, size_t& rBlockSize ) const; CellType GetCellType( SCROW nRow ) const; SCSIZE GetCellCount() const; sal_uInt32 GetWeightedCount() const; diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 943dcd6..0f22f79 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -2712,26 +2712,37 @@ void ScColumn::SetNumberFormat( SCROW nRow, sal_uInt32 nNumberFormat ) ApplyAttr(nRow, SfxUInt32Item(ATTR_VALUE_FORMAT, nNumberFormat)); } -ScFormulaCell * const * ScColumn::GetFormulaCellBlockAddress( SCROW nRow ) const +ScFormulaCell * const * ScColumn::GetFormulaCellBlockAddress( SCROW nRow, size_t& rBlockSize ) const { if (!ValidRow(nRow)) + { + rBlockSize = 0; return NULL; + } std::pair<sc::CellStoreType::const_iterator,size_t> aPos = maCells.position(nRow); sc::CellStoreType::const_iterator it = aPos.first; if (it == maCells.end()) + { + rBlockSize = 0; return NULL; + } if (it->type != sc::element_type_formula) + { // Not a formula cell. + rBlockSize = 0; return NULL; + } + rBlockSize = it->size; return &sc::formula_block::at(*it->data, aPos.second); } const ScFormulaCell* ScColumn::FetchFormulaCell( SCROW nRow ) const { - ScFormulaCell const * const * pp = GetFormulaCellBlockAddress( nRow ); + size_t nBlockSize = 0; + ScFormulaCell const * const * pp = GetFormulaCellBlockAddress( nRow, nBlockSize ); return pp ? *pp : NULL; } diff --git a/sc/source/core/tool/grouparealistener.cxx b/sc/source/core/tool/grouparealistener.cxx index be4b0f0..86be4f7 100644 --- a/sc/source/core/tool/grouparealistener.cxx +++ b/sc/source/core/tool/grouparealistener.cxx @@ -86,16 +86,18 @@ FormulaGroupAreaListener::FormulaGroupAreaListener( const ScRange& rRange, const assert(mpColumn); SAL_INFO( "sc.core.grouparealistener", "FormulaGroupAreaListener ctor this " << this << - " range " << maRange.Format(SCA_VALID) << - " mnTopCellRow " << mnTopCellRow << " length " << mnGroupLen); + " range " << (maRange == BCA_LISTEN_ALWAYS ? "LISTEN-ALWAYS" : maRange.Format(SCA_VALID)) << + " mnTopCellRow " << mnTopCellRow << " length " << mnGroupLen << + ", col/tab " << mpColumn->GetCol() << "/" << mpColumn->GetTab()); } FormulaGroupAreaListener::~FormulaGroupAreaListener() { SAL_INFO( "sc.core.grouparealistener", "FormulaGroupAreaListener dtor this " << this << - " range " << maRange.Format(SCA_VALID) << - " mnTopCellRow " << mnTopCellRow << " length " << mnGroupLen); + " range " << (maRange == BCA_LISTEN_ALWAYS ? "LISTEN-ALWAYS" : maRange.Format(SCA_VALID)) << + " mnTopCellRow " << mnTopCellRow << " length " << mnGroupLen << + ", col/tab " << mpColumn->GetCol() << "/" << mpColumn->GetTab()); } ScRange FormulaGroupAreaListener::getListeningRange() const @@ -184,13 +186,33 @@ void FormulaGroupAreaListener::collectFormulaCells( { SAL_INFO( "sc.core.grouparealistener", "FormulaGroupAreaListener::collectFormulaCells() this " << this << - " range " << maRange.Format(SCA_VALID) << - " mnTopCellRow " << mnTopCellRow << " length " << mnGroupLen); + " range " << (maRange == BCA_LISTEN_ALWAYS ? "LISTEN-ALWAYS" : maRange.Format(SCA_VALID)) << + " mnTopCellRow " << mnTopCellRow << " length " << mnGroupLen << + ", col/tab " << mpColumn->GetCol() << "/" << mpColumn->GetTab()); - ScFormulaCell* const * pp = mpColumn->GetFormulaCellBlockAddress( mnTopCellRow); - assert(pp); + size_t nBlockSize = 0; + ScFormulaCell* const * pp = mpColumn->GetFormulaCellBlockAddress( mnTopCellRow, nBlockSize); if (!pp) + { + SAL_WARN("sc", "GetFormulaCellBlockAddress not found"); return; + } + + /* FIXME: with tdf#89957 it happened that the actual block size in column + * AP (shifted from AO) of sheet 'w' was smaller than the remembered group + * length and correct. This is just a very ugly workaround, the real cause + * is yet unknown, but at least don't crash in such case. The intermediate + * cause is that not all affected group area listeners are destroyed and + * newly created, so mpColumn still points to the old column that then has + * the content of a shifted column. Effectively this workaround has the + * consequence that the group area listener is fouled up and not all + * formula cells are notified.. */ + if (nBlockSize < static_cast<size_t>(mnGroupLen)) + { + SAL_WARN("sc.core","FormulaGroupAreaListener::collectFormulaCells() nBlockSize " << + nBlockSize << " < " << mnGroupLen << " mnGroupLen"); + const_cast<FormulaGroupAreaListener*>(this)->mnGroupLen = static_cast<SCROW>(nBlockSize); + } ScFormulaCell* const * ppEnd = pp + mnGroupLen; @@ -280,8 +302,9 @@ ScAddress FormulaGroupAreaListener::getTopCellPos() const const ScFormulaCell* FormulaGroupAreaListener::getTopCell() const { - const ScFormulaCell* const * pp = mpColumn->GetFormulaCellBlockAddress( mnTopCellRow); - assert(pp); + size_t nBlockSize = 0; + const ScFormulaCell* const * pp = mpColumn->GetFormulaCellBlockAddress( mnTopCellRow, nBlockSize); + SAL_WARN_IF(!pp, "sc", "GetFormulaCellBlockAddress not found"); return pp ? *pp : NULL; } commit 1f31a8c7bae032a8b1acf6a87035c5e22abc0161 Author: László Németh <laszlo.nem...@collabora.com> Date: Mon Apr 20 01:56:07 2015 +0200 Add "eg." and "ie." to the English sentence exception lists "eg." and "ie." are frequent informal alternatives of "e.g." and "i.e.", (e.g., see http://en.wiktionary.org/wiki/eg), but these word forms weren't in the sentence exception list, resulting unnecessary automatic capitalization of the next words, "eg. Here." Avoiding double trouble, this capitalization is disabled now, like in the case of "i.e." and "e.g.". Change-Id: I86819ae62967de3fe4ea5d032972b3ad30f059f2 Reviewed-by: Jan Holesovsky <ke...@collabora.com> diff --git a/extras/source/autocorr/lang/en-AU/SentenceExceptList.xml b/extras/source/autocorr/lang/en-AU/SentenceExceptList.xml index a815467..b442d98 100644 --- a/extras/source/autocorr/lang/en-AU/SentenceExceptList.xml +++ b/extras/source/autocorr/lang/en-AU/SentenceExceptList.xml @@ -23,6 +23,7 @@ <block-list:block block-list:abbreviated-name="dept."/> <block-list:block block-list:abbreviated-name="dr."/> <block-list:block block-list:abbreviated-name="e."/> + <block-list:block block-list:abbreviated-name="eg."/> <block-list:block block-list:abbreviated-name="e.g."/> <block-list:block block-list:abbreviated-name="equip."/> <block-list:block block-list:abbreviated-name="esp."/> @@ -40,6 +41,7 @@ <block-list:block block-list:abbreviated-name="h."/> <block-list:block block-list:abbreviated-name="hr."/> <block-list:block block-list:abbreviated-name="hrs."/> + <block-list:block block-list:abbreviated-name="ie."/> <block-list:block block-list:abbreviated-name="i.e."/> <block-list:block block-list:abbreviated-name="ib."/> <block-list:block block-list:abbreviated-name="ibid."/> diff --git a/extras/source/autocorr/lang/en-GB/SentenceExceptList.xml b/extras/source/autocorr/lang/en-GB/SentenceExceptList.xml index a815467..b442d98 100644 --- a/extras/source/autocorr/lang/en-GB/SentenceExceptList.xml +++ b/extras/source/autocorr/lang/en-GB/SentenceExceptList.xml @@ -23,6 +23,7 @@ <block-list:block block-list:abbreviated-name="dept."/> <block-list:block block-list:abbreviated-name="dr."/> <block-list:block block-list:abbreviated-name="e."/> + <block-list:block block-list:abbreviated-name="eg."/> <block-list:block block-list:abbreviated-name="e.g."/> <block-list:block block-list:abbreviated-name="equip."/> <block-list:block block-list:abbreviated-name="esp."/> @@ -40,6 +41,7 @@ <block-list:block block-list:abbreviated-name="h."/> <block-list:block block-list:abbreviated-name="hr."/> <block-list:block block-list:abbreviated-name="hrs."/> + <block-list:block block-list:abbreviated-name="ie."/> <block-list:block block-list:abbreviated-name="i.e."/> <block-list:block block-list:abbreviated-name="ib."/> <block-list:block block-list:abbreviated-name="ibid."/> diff --git a/extras/source/autocorr/lang/en-US/SentenceExceptList.xml b/extras/source/autocorr/lang/en-US/SentenceExceptList.xml index a815467..b442d98 100644 --- a/extras/source/autocorr/lang/en-US/SentenceExceptList.xml +++ b/extras/source/autocorr/lang/en-US/SentenceExceptList.xml @@ -23,6 +23,7 @@ <block-list:block block-list:abbreviated-name="dept."/> <block-list:block block-list:abbreviated-name="dr."/> <block-list:block block-list:abbreviated-name="e."/> + <block-list:block block-list:abbreviated-name="eg."/> <block-list:block block-list:abbreviated-name="e.g."/> <block-list:block block-list:abbreviated-name="equip."/> <block-list:block block-list:abbreviated-name="esp."/> @@ -40,6 +41,7 @@ <block-list:block block-list:abbreviated-name="h."/> <block-list:block block-list:abbreviated-name="hr."/> <block-list:block block-list:abbreviated-name="hrs."/> + <block-list:block block-list:abbreviated-name="ie."/> <block-list:block block-list:abbreviated-name="i.e."/> <block-list:block block-list:abbreviated-name="ib."/> <block-list:block block-list:abbreviated-name="ibid."/> diff --git a/extras/source/autocorr/lang/en-ZA/SentenceExceptList.xml b/extras/source/autocorr/lang/en-ZA/SentenceExceptList.xml index 10c8df7..8ca17d4 100644 --- a/extras/source/autocorr/lang/en-ZA/SentenceExceptList.xml +++ b/extras/source/autocorr/lang/en-ZA/SentenceExceptList.xml @@ -35,6 +35,7 @@ <block-list:block block-list:abbreviated-name="dept."/> <block-list:block block-list:abbreviated-name="dr."/> <block-list:block block-list:abbreviated-name="e."/> + <block-list:block block-list:abbreviated-name="eg."/> <block-list:block block-list:abbreviated-name="e.g."/> <block-list:block block-list:abbreviated-name="e.m.f."/> <block-list:block block-list:abbreviated-name="Econ."/> @@ -56,6 +57,7 @@ <block-list:block block-list:abbreviated-name="Hon."/> <block-list:block block-list:abbreviated-name="hr."/> <block-list:block block-list:abbreviated-name="hrs."/> + <block-list:block block-list:abbreviated-name="ie."/> <block-list:block block-list:abbreviated-name="i.e."/> <block-list:block block-list:abbreviated-name="ib."/> <block-list:block block-list:abbreviated-name="ibid."/> commit 812fbc5fb2c5e3af6b709530639d697d3268c3be Author: Henry Castro <hcas...@collabora.com> Date: Mon Apr 13 20:32:22 2015 -0400 Resolves tdf#83366 Copy and Paste crashes Calc when original doc closed Change-Id: I5ab279a7d7af6829735b47ef5228f56dc77580c9 Reviewed-on: https://gerrit.libreoffice.org/15448 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Eike Rathke <er...@redhat.com> diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 6313fa5..c7bb18d 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -818,35 +818,38 @@ Reference< XDataSequence > XclImpChSourceLink::CreateDataSequence( const OUStrin { Reference< XDataSequence > xDataSeq; Reference< XDataProvider > xDataProv = GetDataProvider(); - if( xDataProv.is() && mxTokenArray ) + if( xDataProv.is() ) { - ScCompiler aComp( GetDocPtr(), ScAddress(), *mxTokenArray ); - aComp.SetGrammar(GetDoc().GetGrammar()); - OUStringBuffer aRangeRep; - aComp.CreateStringFromTokenArray( aRangeRep ); - try - { - xDataSeq = xDataProv->createDataSequenceByRangeRepresentation( aRangeRep.makeStringAndClear() ); - // set sequence role - ScfPropertySet aSeqProp( xDataSeq ); - aSeqProp.SetProperty( EXC_CHPROP_ROLE, rRole ); - } - catch( Exception& ) + if ( mxTokenArray ) { -// OSL_FAIL( "XclImpChSourceLink::CreateDataSequence - cannot create data sequence" ); + ScCompiler aComp( GetDocPtr(), ScAddress(), *mxTokenArray ); + aComp.SetGrammar(GetDoc().GetGrammar()); + OUStringBuffer aRangeRep; + aComp.CreateStringFromTokenArray( aRangeRep ); + try + { + xDataSeq = xDataProv->createDataSequenceByRangeRepresentation( aRangeRep.makeStringAndClear() ); + // set sequence role + ScfPropertySet aSeqProp( xDataSeq ); + aSeqProp.SetProperty( EXC_CHPROP_ROLE, rRole ); + } + catch( Exception& ) + { + // OSL_FAIL( "XclImpChSourceLink::CreateDataSequence - cannot create data sequence" ); + } } - } - else if( rRole == EXC_CHPROP_ROLE_LABEL && mxString && !mxString->GetText().isEmpty() ) - { - try + else if( rRole == EXC_CHPROP_ROLE_LABEL && mxString && !mxString->GetText().isEmpty() ) { - OUString aString("\""); - xDataSeq = xDataProv->createDataSequenceByRangeRepresentation( aString + mxString->GetText() + aString ); - // set sequence role - ScfPropertySet aSeqProp( xDataSeq ); - aSeqProp.SetProperty( EXC_CHPROP_ROLE, rRole ); + try + { + OUString aString("\""); + xDataSeq = xDataProv->createDataSequenceByRangeRepresentation( aString + mxString->GetText() + aString ); + // set sequence role + ScfPropertySet aSeqProp( xDataSeq ); + aSeqProp.SetProperty( EXC_CHPROP_ROLE, rRole ); + } + catch( Exception& ) { } } - catch( Exception& ) { } } return xDataSeq; } commit 505920b3e959dec5fb2afc83246b5f495fe318f5 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Apr 15 09:41:10 2015 +0100 fix col limit crash on export of ooo103315-1.ods to xls Change-Id: Ic68ddc56d9cf9dd410c1f073ba83bfeea8220bf0 (cherry picked from commit cee6eb254fae1012bc6ffe1b2e440fe58fedac1b) Reviewed-on: https://gerrit.libreoffice.org/15318 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Eike Rathke <er...@redhat.com> diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index 3c8dffc..3186412 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -1345,7 +1345,8 @@ bool XclExpXct::BuildCrnList( XclExpCrnList& rCrnRecs ) for( SCROW nScRow = nScRow1; bValid && (nScRow <= nScRow2); ++nScRow ) { ::std::pair< SCCOL, SCCOL > aColRange = mxCacheTable->getColRange( nScRow ); - for( SCCOL nScCol = aColRange.first; bValid && (nScCol < aColRange.second); ++nScCol ) + const SCCOL nScEnd = ::std::min( aColRange.second, MAXCOLCOUNT ); + for( SCCOL nScCol = aColRange.first; bValid && (nScCol < nScEnd); ++nScCol ) { if( maUsedCells.IsCellMarked( nScCol, nScRow, true ) ) { commit aa7ae43b882b116ba8f4b9b4610ff35ca903d755 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Apr 15 10:04:05 2015 +0100 fix crash on export of fdo68639-2.ods to xls with invalid mnLastIdx mnLastIdx doesn't get reset when the color list is reset, the code already acknowledges that mnLastIdx is the last set index but that it may not be a valid position, so only set rnIndex if mnLastIdx is valid and the data at that pos is the desired data. Change-Id: I57ce32fd1a13bfe9049ed94be34229c8c2808b8e (cherry picked from commit 6c3b1361a97f5219f90bf2f09f3c3f2b70b8e30e) Reviewed-on: https://gerrit.libreoffice.org/15320 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Eike Rathke <er...@redhat.com> diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 5b49205..5dd6b98 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -509,18 +509,22 @@ const Color& XclExpPaletteImpl::GetOriginalColor( sal_uInt32 nColorId ) const XclListColor* XclExpPaletteImpl::SearchListEntry( const Color& rColor, sal_uInt32& rnIndex ) { - rnIndex = mnLastIdx; - XclListColor* pEntry = NULL; + rnIndex = 0; if (mxColorList->empty()) return NULL; + XclListColor* pEntry = NULL; + // search optimization for equal-colored objects occurring repeatedly - if (rnIndex < mxColorList->size()) + if (mnLastIdx < mxColorList->size()) { - pEntry = &(*mxColorList)[rnIndex]; + pEntry = &(*mxColorList)[mnLastIdx]; if( pEntry->GetColor() == rColor ) + { + rnIndex = mnLastIdx; return pEntry; + } } // binary search for color commit 43a51c4bc6be6b5b15aa44ce6f3bbb1c06d58181 Author: Julien Nabet <serval2...@yahoo.fr> Date: Sat Apr 18 23:13:51 2015 +0200 tdf#55502: Shell BASIC function with empty third param hangs bt: 2 0x00002aaaab2b5226 in __assert_fail_base (fmt=0x2aaaab3ebce8 "%s%s%s:%u: %s%sAssertion `%s' failed. %n", assertion=assertion@entry=0x2aaaae2ecf10 "index >= 0 && static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength())", file=file@entry=0x2aaaae2ecec8 "/home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx", line=line@entry=500, function=function@entry=0x2aaaae2ed740 <rtl::OUString::operator[](int) const::__PRETTY_FUNCTION__> "sal_Unicode rtl::OUString::operator[](sal_Int32) const") at assert.c:92 3 0x00002aaaab2b52d2 in __GI___assert_fail (assertion=0x2aaaae2ecf10 "index >= 0 && static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength())", file=0x2aaaae2ecec8 "/home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx", line=500, function=0x2aaaae2ed740 <rtl::OUString::operator[](int) const::__PRETTY_FUNCTION__> "sal_Unicode rtl::OUString::operator[](sal_Int32) const") at assert.c:101 4 0x00002aaaae1f44f8 in rtl::OUString::operator[] (this=0x7fffffff36b0, index=13) at /home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx:500 5 0x00002aaaae274036 in SbRtl_Shell (pBasic=0x3531fc0, rPar=..., bWrite=false) at /home/julien/compile-libreoffice/libreoffice/basic/source/runtime/methods.cxx:3613 Check if third param isn't empty, if not, aCmdLine finishes with a space character Change-Id: I095b6dc7c7d2d4c826fb47aa1414c558bbc27c04 Reviewed-on: https://gerrit.libreoffice.org/15380 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 51df75b..545e396 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -3590,8 +3590,12 @@ RTLFUNC(Shell) // attach additional parameters - everything must be parsed anyway if( nArgCount >= 4 ) { - aCmdLine += " "; - aCmdLine += rPar.Get(3)->GetOUString(); + OUString tmp = rPar.Get(3)->GetOUString().trim(); + if (!tmp.isEmpty()) + { + aCmdLine += " "; + aCmdLine += tmp; + } } else if( aCmdLine.isEmpty() ) { commit c4a346a2195c2d7d642d8c6f48723d4d854ae4e4 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Apr 3 15:03:34 2015 +0100 Resolves: tdf#82998 no object:active descendant changed emitted for listboxes in WB_DROPDOWN mode which means the dropdown exists, but when the drop down is not activated. I think it's plausible that there was confusion around "b_IsDropDownList" and that the meaning taken by the author was the the dropdown is active if b_IsDropDownList is set, so renamed that to bHasDropDownList and take the old "b_IsDropDownList" path when "b_IsDropDownList && ..IsInDropDown()" Folded the then both equal code paths of the LISTBOX code together. No idea if there should be an additional equivalent AccessibleEventId::SELECTION_CHANGED for LISTBOXES like COMBOBOX instead of AccessibleEventId::ACTIVE_DESCENDANT_CHANGED in the dropdown not active case. Change-Id: I6db3ec21b392b7bf1b488235464202bb326f2535 (cherry picked from commit 74e673b49fdf8daa3365961de5fb0c9c6d831279) Reviewed-on: https://gerrit.libreoffice.org/15389 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx index 5311dd1..9e2725b 100644 --- a/accessibility/source/standard/vclxaccessiblelist.cxx +++ b/accessibility/source/standard/vclxaccessiblelist.cxx @@ -205,7 +205,7 @@ void VCLXAccessibleList::UpdateSelection_Acc (const ::rtl::OUString& sTextOfSele } -void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool b_IsDropDownList) +void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool bHasDropDownList) { uno::Any aOldValue, aNewValue; @@ -261,22 +261,18 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool b_IsDropDownList) if (m_aBoxType == COMBOBOX) { - if (b_IsDropDownList) + //VCLXAccessibleDropDownComboBox + //when in list is dropped down, xText = NULL + if (bHasDropDownList && m_pListBoxHelper && m_pListBoxHelper->IsInDropDown()) { - //VCLXAccessibleDropDownComboBox - //when in list is dropped down, xText = NULL - if (m_pListBoxHelper && m_pListBoxHelper->IsInDropDown()) + if ( aNewValue.hasValue() || aOldValue.hasValue() ) { - if ( aNewValue.hasValue() || aOldValue.hasValue() ) - { - NotifyAccessibleEvent( - AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, - aOldValue, - aNewValue ); - - NotifyListItem(aNewValue); + NotifyAccessibleEvent( + AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, + aOldValue, + aNewValue ); - } + NotifyListItem(aNewValue); } } else @@ -287,34 +283,14 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool b_IsDropDownList) } else if (m_aBoxType == LISTBOX) { - if (b_IsDropDownList) + if ( aNewValue.hasValue() || aOldValue.hasValue() ) { - //VCLXAccessibleDropdownListBox - //when in list is dropped down, xText = NULL - if (m_pListBoxHelper && m_pListBoxHelper->IsInDropDown()) - { - if ( aNewValue.hasValue() || aOldValue.hasValue() ) - { - NotifyAccessibleEvent( - AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, - aOldValue, - aNewValue ); + NotifyAccessibleEvent( + AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, + aOldValue, + aNewValue ); - NotifyListItem(aNewValue); - } - } - } - else - { - if ( aNewValue.hasValue() || aOldValue.hasValue() ) - { - NotifyAccessibleEvent( - AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, - aOldValue, - aNewValue ); - - NotifyListItem(aNewValue); - } + NotifyListItem(aNewValue); } } } commit 89b7410d6e000b847485f91be0c29db91d0e51a4 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Apr 3 14:18:04 2015 +0100 Related: tdf#82998 assume VALUE_CHANGED makes sense only for windows jdiggs: I believe [VALUE_CHANGED] is expected for Windows' accessibility APIs. However for ATK/AT-SPI2, value-change events are expected only for the sorts of things which implement AtkValue (scrollbars, progressbars, sliders, spinbuttons, etc.) Combo boxes, lists, and the like should not be emitting this event. Change-Id: I9dcab7fb4004a24f88915f904eb508dfee2d4ae5 (cherry picked from commit 835fcfacc66601299aa73cd5423e8277ccd8fc34) Reviewed-on: https://gerrit.libreoffice.org/15387 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx b/accessibility/source/standard/vclxaccessiblebox.cxx index c75e8b4..c1bfdea 100644 --- a/accessibility/source/standard/vclxaccessiblebox.cxx +++ b/accessibility/source/standard/vclxaccessiblebox.cxx @@ -124,10 +124,12 @@ void VCLXAccessibleBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEven if ( pList != NULL ) { pList->ProcessWindowEvent (rVclWindowEvent, m_bIsDropDownBox); +#if defined WNT if (m_bIsDropDownBox) { NotifyAccessibleEvent(AccessibleEventId::VALUE_CHANGED, Any(), Any()); } +#endif } break; } @@ -179,8 +181,10 @@ void VCLXAccessibleBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEven if ( sText.isEmpty() ) sText = xText->getText(); pList->UpdateSelection_Acc(sText, m_bIsDropDownBox); +#if defined WNT if (m_bIsDropDownBox || ( !m_bIsDropDownBox && m_aBoxType==COMBOBOX)) NotifyAccessibleEvent(AccessibleEventId::VALUE_CHANGED, Any(), Any()); +#endif } } break; @@ -545,7 +549,7 @@ void VCLXAccessibleBox::FillAccessibleStateSet( utl::AccessibleStateSetHelper& r ListBox* pListBox = static_cast< ListBox* >( GetWindow() ); if (pListBox != NULL && pListBox->GetEntryCount() > 0) { - nSelectedEntryCount = pListBox->GetSelectEntryCount(); + nSelectedEntryCount = pListBox->GetSelectEntryCount(); if ( nSelectedEntryCount == 0) rStateSet.AddState(AccessibleStateType::INDETERMINATE); } commit b1396ad5feaeeaf22e0d70910f849c9edac61e4a Author: Caolán McNamara <caol...@redhat.com> Date: Fri Apr 3 14:55:26 2015 +0100 Related: tdf#82998 rearrange, no logic change Change-Id: I1d3a6a552bd535622009b43e0633a357b1a919e6 ... etc. - the rest is truncated
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits