[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - 5 commits - svx/source sw/qa sw/source vcl/source
Matúš Kukan
matus.kukan at collabora.com
Wed Jun 25 00:42:57 PDT 2014
svx/source/form/formcontroller.cxx | 6 +++-
svx/source/gallery2/gallery1.cxx | 38 +++++++-----------------------
svx/source/table/cell.cxx | 14 +++--------
svx/source/table/cell.hxx | 1
svx/source/table/tablelayouter.cxx | 8 +++---
sw/qa/extras/ww8import/data/bnc875715.doc |binary
sw/qa/extras/ww8import/ww8import.cxx | 8 ++++++
sw/source/filter/ww8/ww8par.cxx | 37 +++++++++++++++--------------
vcl/source/gdi/outdev4.cxx | 27 +++------------------
9 files changed, 54 insertions(+), 85 deletions(-)
New commits:
commit 84cd37f4d73446b7821a8561d9c768207ed4384e
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Tue Jun 17 12:58:09 2014 +0200
bnc#593614: Avoid rendering artefacts in presentation mode.
By not using XOR rendering, see also fdo#38844.
The first variant seems to work better.
Basically, this is just cherry-pick of
bb5c7d6a79309236d4f19bb2498f2e850f735a2f
Change-Id: I0fdccf60601a47c91f467f9d1321d1c25f1ef68c
Reviewed-on: https://gerrit.libreoffice.org/9824
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/vcl/source/gdi/outdev4.cxx b/vcl/source/gdi/outdev4.cxx
index 1be80e9..e817e57 100644
--- a/vcl/source/gdi/outdev4.cxx
+++ b/vcl/source/gdi/outdev4.cxx
@@ -740,29 +740,10 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
mpMetaFile->AddAction( new MetaCommentAction( "XGRAD_SEQ_BEGIN" ) );
mpMetaFile->AddAction( new MetaGradientExAction( rPolyPoly, rGradient ) );
- if( OUTDEV_PRINTER == meOutDevType )
- {
- Push( PUSH_CLIPREGION );
- IntersectClipRegion(Region(rPolyPoly));
- DrawGradient( aRect, rGradient );
- Pop();
- }
- else
- {
- const sal_Bool bOldOutput = IsOutputEnabled();
-
- EnableOutput( sal_False );
- Push( PUSH_RASTEROP );
- SetRasterOp( ROP_XOR );
- DrawGradient( aRect, rGradient );
- SetFillColor( COL_BLACK );
- SetRasterOp( ROP_0 );
- DrawPolyPolygon( rPolyPoly );
- SetRasterOp( ROP_XOR );
- DrawGradient( aRect, rGradient );
- Pop();
- EnableOutput( bOldOutput );
- }
+ Push( PUSH_CLIPREGION );
+ IntersectClipRegion(Region(rPolyPoly));
+ DrawGradient( aRect, rGradient );
+ Pop();
mpMetaFile->AddAction( new MetaCommentAction( "XGRAD_SEQ_END" ) );
}
commit 7408012edc03c1f84a052a5f979b71315fb59736
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Sat Jun 21 19:53:37 2014 +0200
Resolves: fdo#80327 Sound list box when non-English UI
Fallback strings are in English wheresas ImplGetThemeEntry expects localized strings
Let's put localized strings in fallback to make ImplGetThemeEntry happy
Change-Id: I27dd992bac4f5aaf6e0e6237fe59dac990f11c92
Reviewed-on: https://gerrit.libreoffice.org/9846
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx
index 12f2a0a..004570b 100644
--- a/svx/source/gallery2/gallery1.cxx
+++ b/svx/source/gallery2/gallery1.cxx
@@ -434,66 +434,48 @@ OUString Gallery::GetThemeName( sal_uIntPtr nThemeId ) const
// try fallback, if no entry was found
if( !pFound )
{
- OString aFallback;
+ OUString aFallback;
switch( nThemeId )
{
case( GALLERY_THEME_3D ):
- aFallback = "3D";
+ aFallback = GAL_RESSTR(RID_GALLERYSTR_THEME_3D);
break;
case( GALLERY_THEME_BULLETS ):
- aFallback = "Bullets";
+ aFallback = GAL_RESSTR(RID_GALLERYSTR_THEME_BULLETS);
break;
case( GALLERY_THEME_HOMEPAGE ):
- aFallback = "Homepage";
+ aFallback = GAL_RESSTR(RID_GALLERYSTR_THEME_HOMEPAGE);
break;
case( GALLERY_THEME_POWERPOINT ):
- aFallback = "private://gallery/hidden/imgppt";
+ aFallback = GAL_RESSTR(RID_GALLERYSTR_THEME_POWERPOINT);
break;
case( GALLERY_THEME_FONTWORK ):
- aFallback = "private://gallery/hidden/fontwork";
+ aFallback = GAL_RESSTR(RID_GALLERYSTR_THEME_FONTWORK);
break;
case( GALLERY_THEME_FONTWORK_VERTICAL ):
- aFallback = "private://gallery/hidden/fontworkvertical";
+ aFallback = GAL_RESSTR(RID_GALLERYSTR_THEME_FONTWORK_VERTICAL);
break;
case( GALLERY_THEME_SOUNDS ):
- aFallback = "Sounds";
+ aFallback = GAL_RESSTR(RID_GALLERYSTR_THEME_SOUNDS);
break;
case( RID_GALLERYSTR_THEME_ARROWS ):
- aFallback = "Arrows";
- break;
case( RID_GALLERYSTR_THEME_COMPUTERS ):
- aFallback = "Computers";
- break;
case( RID_GALLERYSTR_THEME_DIAGRAMS ):
- aFallback = "Diagrams";
- break;
case( RID_GALLERYSTR_THEME_EDUCATION ):
- aFallback = "Education";
- break;
case( RID_GALLERYSTR_THEME_ENVIRONMENT ):
- aFallback = "Environment";
- break;
case( RID_GALLERYSTR_THEME_FINANCE ):
- aFallback = "Finance";
- break;
case( RID_GALLERYSTR_THEME_PEOPLE ):
- aFallback = "People";
- break;
case( RID_GALLERYSTR_THEME_SYMBOLS ):
- aFallback = "Symbols";
- break;
case( RID_GALLERYSTR_THEME_TRANSPORT ):
- aFallback = "Transport";
- break;
case( RID_GALLERYSTR_THEME_TXTSHAPES ):
- aFallback = "Textshapes";
+ aFallback = GAL_RESSTR(static_cast<sal_uInt32>(nThemeId));
break;
default:
break;
}
- pFound = const_cast<Gallery*>(this)->ImplGetThemeEntry(OStringToOUString(aFallback, RTL_TEXTENCODING_ASCII_US));
+ pFound = const_cast<Gallery*>(this)->ImplGetThemeEntry(aFallback);
}
return( pFound ? pFound->GetThemeName() : OUString() );
commit a852d9e16d028a83bd11adbcf5632a6fec0577b5
Author: LuboÅ¡ LuÅák <l.lunak at collabora.com>
Date: Tue Jun 24 14:14:14 2014 +0200
fix reading of section margins (bnc#875715)
The reason the section ended up with incorrect margins was because
that is computed as 'page margin' - 'section offset', and the order
of setting these up was backwards: First InsertSection() created
the section using the page margin of the old page, and only afterwards
SetSwFmtPageDesc() set the page margin that should be used.
Conflicts:
sw/source/filter/ww8/ww8par.cxx
Change-Id: I18ddcb0b5928879a2297b6caca766eab979abd45
Reviewed-on: https://gerrit.libreoffice.org/9879
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/qa/extras/ww8import/data/bnc875715.doc b/sw/qa/extras/ww8import/data/bnc875715.doc
new file mode 100644
index 0000000..af15e14
Binary files /dev/null and b/sw/qa/extras/ww8import/data/bnc875715.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index dea54e5..db1ca82 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -270,6 +270,14 @@ DECLARE_WW8IMPORT_TEST(testBnc863018, "bnc863018.doc")
CPPUNIT_ASSERT_EQUAL(sal_Int32(5002), getProperty<sal_Int32>(xTable, "TopMargin"));
}
+DECLARE_WW8IMPORT_TEST(testBnc875715, "bnc875715.doc")
+{
+ uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY);
+ // Was incorrectly set as -1270.
+ CPPUNIT_ASSERT_EQUAL(0, getProperty<sal_Int32>(xSections->getByIndex(0), "SectionLeftMargin"));
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index ea556ae..4df1185 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4506,24 +4506,6 @@ void wwSectionManager::InsertSegments()
aSectPaM.GetPoint()->nContent.Assign(
aSectPaM.GetCntntNode(), 0);
- // End getting the bounds of this section, quite a job eh?
- SwSectionFmt *pRet = InsertSection(aSectPaM, *aIter);
- // The last section if continous is always unbalanced
- if (pRet)
- {
- // Set the columns to be UnBalanced if that compatability option is set
- if (mrReader.pWDop->fNoColumnBalance)
- pRet->SetFmtAttr(SwFmtNoBalancedColumns(true));
- else
- {
- // Otherwise set to unbalanced if the following section is
- // not continuous, (which also means that the last section
- // is unbalanced)
- if (aNext == aEnd || !aNext->IsContinuous())
- pRet->SetFmtAttr(SwFmtNoBalancedColumns(true));
- }
- }
-
bool bHasOwnHdFt = false;
/*
In this nightmare scenario the continuous section has its own
@@ -4569,6 +4551,25 @@ void wwSectionManager::InsertSegments()
aIter->mpPage = pOrig;
}
}
+
+ // End getting the bounds of this section, quite a job eh?
+ SwSectionFmt *pRet = InsertSection(aSectPaM, *aIter);
+ // The last section if continous is always unbalanced
+ if (pRet)
+ {
+ // Set the columns to be UnBalanced if that compatability option is set
+ if (mrReader.pWDop->fNoColumnBalance)
+ pRet->SetFmtAttr(SwFmtNoBalancedColumns(true));
+ else
+ {
+ // Otherwise set to unbalanced if the following section is
+ // not continuous, (which also means that the last section
+ // is unbalanced)
+ if (aNext == aEnd || !aNext->IsContinuous())
+ pRet->SetFmtAttr(SwFmtNoBalancedColumns(true));
+ }
+ }
+
}
if (pTxtNd)
commit 51b010777641244ee3beeddb65e5bce24251594c
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Jun 24 11:40:23 2014 +0200
fdo#75339: Substituting XInterface* eq. for object eq. requires queryInterface
Regression introduced with 6a043e9c0acff20e1618ca8ec15c21d5d0fd0d37 "Use the new
type-checking Reference constructor to reduce code noise" which should have left
(at least some) "querying upcasts" to XInterface alone. Closer inspection of
that commit will probably turn up further regressions that need to be reverted.
Change-Id: Ib81afc12d9df205b5b0fe6cec6ce85d012e9629f
(cherry picked from commit f8115ce72dad45b82b044d9c8f5c253d0514574d)
Reviewed-on: https://gerrit.libreoffice.org/9875
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 109e77a..69cd855 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -353,6 +353,8 @@ void ColumnInfoCache::initializeControls( const Sequence< Reference< XControl >
lcl_resetColumnControlInfo( *col );
+ Reference< XInterface > xNormColumn( col->xColumn, UNO_QUERY_THROW );
+
const Reference< XControl >* pControl( _rControls.getConstArray() );
const Reference< XControl >* pControlEnd( pControl + _rControls.getLength() );
for ( ; pControl != pControlEnd; ++pControl )
@@ -374,7 +376,7 @@ void ColumnInfoCache::initializeControls( const Sequence< Reference< XControl >
{
Reference< XPropertySet > xGridColumnModel( xGridColAccess->getByIndex( gridCol ), UNO_QUERY_THROW );
- if ( !lcl_isBoundTo( xGridColumnModel, col->xColumn )
+ if ( !lcl_isBoundTo( xGridColumnModel, xNormColumn )
|| !lcl_isInputRequired( xGridColumnModel )
)
continue; // with next grid column
@@ -394,7 +396,7 @@ void ColumnInfoCache::initializeControls( const Sequence< Reference< XControl >
}
if ( !xModelPSI->hasPropertyByName( FM_PROP_BOUNDFIELD )
- || !lcl_isBoundTo( xModel, col->xColumn )
+ || !lcl_isBoundTo( xModel, xNormColumn )
|| !lcl_isInputRequired( xModel )
)
continue; // with next control
commit 3e9f1f437c7a581aaf1808450ba62d6f37de0697
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Mon Jun 23 19:20:07 2014 +0200
Related bnc#822625: Minimum height was not invalidated when rectangle changes.
5792e76cb5beb630c135f57b74f57d74dd2dc2b0 was too optimistic and did not
invalidate mnCachedMinHeight often enough.
This was resulting in a grey area below table frame when resizing it.
So, revert 5792e76cb5beb630c135f57b74f57d74dd2dc2b0
"Related bnc#822625: Cache minimum height for table cells."
and istead just use getMinimumWidth() in TableLayouter if that's all we need.
getMinimumHeight() is expensive.
Change-Id: I34c49dda75d6ccccaa5b4d3746114352621a40dd
(cherry picked from commit b8f7ea5da41d61d405adec54dcd10b54ee0e5591)
Reviewed-on: https://gerrit.libreoffice.org/9871
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 7e04db7..d4f199b 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -358,7 +358,6 @@ Cell::Cell( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ) th
, mbMerged( sal_False )
, mnRowSpan( 1 )
, mnColSpan( 1 )
-, mnCachedMinHeight( -1 )
, mxTable( rTableObj.getTable() )
{
if( rTableObj.GetModel() )
@@ -525,7 +524,6 @@ void Cell::setMerged()
void Cell::notifyModified()
{
- mnCachedMinHeight = -1;
if( mxTable.is() )
mxTable->setModified( sal_True );
}
@@ -682,10 +680,8 @@ sal_Int32 Cell::getMinimumHeight()
if( !mpProperties )
return 0;
- if( mnCachedMinHeight != -1 )
- return mnCachedMinHeight;
-
SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
+ sal_Int32 nMinimumHeight = 0;
Rectangle aTextRect;
TakeTextAnchorRect( aTextRect );
@@ -696,7 +692,7 @@ sal_Int32 Cell::getMinimumHeight()
if(pEditOutliner)
{
pEditOutliner->SetMaxAutoPaperSize(aSize);
- mnCachedMinHeight = pEditOutliner->GetTextHeight()+1;
+ nMinimumHeight = pEditOutliner->GetTextHeight()+1;
}
else /*if ( hasText() )*/
{
@@ -709,12 +705,12 @@ sal_Int32 Cell::getMinimumHeight()
{
rOutliner.SetText(*GetOutlinerParaObject());
}
- mnCachedMinHeight=rOutliner.GetTextHeight()+1;
+ nMinimumHeight=rOutliner.GetTextHeight()+1;
rOutliner.Clear();
}
- mnCachedMinHeight += GetTextUpperDistance() + GetTextLowerDistance();
- return mnCachedMinHeight;
+ nMinimumHeight += GetTextUpperDistance() + GetTextLowerDistance();
+ return nMinimumHeight;
}
// -----------------------------------------------------------------------------
diff --git a/svx/source/table/cell.hxx b/svx/source/table/cell.hxx
index ba2c6f6..1b26b1c 100644
--- a/svx/source/table/cell.hxx
+++ b/svx/source/table/cell.hxx
@@ -222,7 +222,6 @@ private:
::sal_Bool mbMerged;
::sal_Int32 mnRowSpan;
::sal_Int32 mnColSpan;
- ::sal_Int32 mnCachedMinHeight;
Rectangle maCellRect;
diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx
index 55ed2d2..2b97996 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -556,7 +556,7 @@ void TableLayouter::LayoutTableWidth( Rectangle& rArea, bool bFit )
}
else
{
- nMinWidth = std::max( nMinWidth, xCell->getMinimumSize().Width );
+ nMinWidth = std::max( nMinWidth, xCell->getMinimumWidth() );
}
}
}
@@ -622,7 +622,7 @@ void TableLayouter::LayoutTableWidth( Rectangle& rArea, bool bFit )
while( iter != aMergedCells[nCol].end() )
{
CellRef xCell( (*iter++) );
- sal_Int32 nMinWidth = xCell->getMinimumSize().Width;
+ sal_Int32 nMinWidth = xCell->getMinimumWidth();
for( sal_Int32 nMCol = nCol - xCell->getColumnSpan() + 1; (nMCol > 0) && (nMCol < nCol); ++nMCol )
nMinWidth -= maColumns[nMCol].mnSize;
@@ -706,7 +706,7 @@ void TableLayouter::LayoutTableHeight( Rectangle& rArea, bool bFit )
}
else
{
- nMinHeight = std::max( nMinHeight, xCell->getMinimumSize().Height );
+ nMinHeight = std::max( nMinHeight, xCell->getMinimumHeight() );
}
}
}
@@ -773,7 +773,7 @@ void TableLayouter::LayoutTableHeight( Rectangle& rArea, bool bFit )
while( iter != aMergedCells[nRow].end() )
{
CellRef xCell( (*iter++) );
- sal_Int32 nMinHeight = xCell->getMinimumSize().Height;
+ sal_Int32 nMinHeight = xCell->getMinimumHeight();
for( sal_Int32 nMRow = nRow - xCell->getRowSpan() + 1; (nMRow > 0) && (nMRow < nRow); ++nMRow )
nMinHeight -= maRows[nMRow].mnSize;
More information about the Libreoffice-commits
mailing list