[Libreoffice-commits] core.git: 9 commits - sc/qa sc/source vcl/inc vcl/opengl vcl/source vcl/win
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Sat Nov 29 15:48:09 PST 2014
sc/qa/unit/ucalc.cxx | 42 +++++++++++++++++++++++++++
sc/qa/unit/ucalc.hxx | 2 +
sc/source/core/data/document10.cxx | 7 +++-
sc/source/filter/excel/xecontent.cxx | 22 +++++++++-----
sc/source/ui/unoobj/styleuno.cxx | 24 ++++++++++-----
vcl/inc/opengl/win/gdiimpl.hxx | 2 -
vcl/opengl/gdiimpl.cxx | 15 ++++-----
vcl/opengl/win/gdiimpl.cxx | 9 -----
vcl/source/opengl/OpenGLHelper.cxx | 1
vcl/win/source/gdi/salgdi.cxx | 3 +
vcl/win/source/gdi/salnativewidgets-luna.cxx | 2 -
11 files changed, 91 insertions(+), 38 deletions(-)
New commits:
commit e841dd17a4fb9ba558bcbea5cde5ec90061c1313
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Nov 29 21:08:08 2014 +0100
add test case for fdo#86253
Change-Id: I943351a9050f78ea3495807570c51e0c7782ead3
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 248a0e9..d7d8cdb 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -5635,6 +5635,48 @@ void Test::testCondCopyPasteSingleCell()
m_pDoc->DeleteTab(0);
}
+void Test::testCondCopyPasteSingleCellToRange()
+{
+ m_pDoc->InsertTab(0, "Test");
+
+ ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc);
+ ScRange aCondFormatRange(0,0,0,3,3,0);
+ ScRangeList aRangeList(aCondFormatRange);
+ pFormat->AddRange(aRangeList);
+
+ ScCondFormatEntry* pEntry = new ScCondFormatEntry(SC_COND_DIRECT,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT));
+ pFormat->AddEntry(pEntry);
+ sal_uLong nIndex = m_pDoc->AddCondFormat(pFormat, 0);
+
+ ScDocument aClipDoc(SCDOCMODE_CLIP);
+ copyToClip(m_pDoc, ScRange(0,0,0,0,0,0), &aClipDoc);
+
+ ScRange aTargetRange(4,4,0,4,8,0);
+ pasteFromClip(m_pDoc, aTargetRange, &aClipDoc);
+
+ std::set<sal_uLong> aCondFormatIndices;
+ for(SCROW nRow = 4; nRow <= 8; ++nRow)
+ {
+ ScConditionalFormat* pPastedFormat = m_pDoc->GetCondFormat(4, nRow, 0);
+ CPPUNIT_ASSERT(pPastedFormat);
+
+ CPPUNIT_ASSERT_EQUAL(ScRangeList(ScRange(4, nRow, 0)), pPastedFormat->GetRange());
+ sal_uLong nPastedKey = pPastedFormat->GetKey();
+ CPPUNIT_ASSERT( nIndex != nPastedKey);
+ const SfxPoolItem* pItem = m_pDoc->GetAttr( 4, nRow, 0, ATTR_CONDITIONAL );
+ const ScCondFormatItem* pCondFormatItem = static_cast<const ScCondFormatItem*>(pItem);
+
+ CPPUNIT_ASSERT(pCondFormatItem);
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pCondFormatItem->GetCondFormatData().size());
+ CPPUNIT_ASSERT( nIndex != pCondFormatItem->GetCondFormatData().at(0) );
+ auto itr = aCondFormatIndices.find(nPastedKey);
+ CPPUNIT_ASSERT(itr == aCondFormatIndices.end());
+ aCondFormatIndices.insert(nPastedKey);
+ }
+
+ m_pDoc->DeleteTab(0);
+}
+
void Test::testCondCopyPasteSheetBetweenDoc()
{
m_pDoc->InsertTab(0, "Test");
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index 21568ed..3816998 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -410,6 +410,7 @@ public:
void testCondFormatInsertDeleteSheets();
void testCondCopyPaste();
void testCondCopyPasteSingleCell(); //e.g. fdo#82503
+ void testCondCopyPasteSingleCellToRange(); //e.g. fdo#82503
void testCondCopyPasteSheetBetweenDoc();
void testCondCopyPasteSheet();
void testIconSet();
@@ -606,6 +607,7 @@ public:
CPPUNIT_TEST(testCondFormatInsertDeleteSheets);
CPPUNIT_TEST(testCondCopyPaste);
CPPUNIT_TEST(testCondCopyPasteSingleCell);
+ CPPUNIT_TEST(testCondCopyPasteSingleCellToRange);
CPPUNIT_TEST(testCondCopyPasteSheetBetweenDoc);
CPPUNIT_TEST(testCondCopyPasteSheet);
CPPUNIT_TEST(testIconSet);
commit 1e4fc94c7feff11f28654dcf70cccf77db216143
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Nov 29 20:51:31 2014 +0100
we need to copy the condition format cell for cell, fdo#86253
Change-Id: Ic090e1b9d13780e7e895a85901d3329cc5703688
diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx
index c01b264..0ddfbd1 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -115,8 +115,11 @@ bool ScDocument::CopyOneCellFromClip(
{
maTabs[i]->CopyOneCellFromClip(rCxt, nCol1, nRow1, nCol2, nRow2);
if (rCxt.getInsertFlag() & IDF_ATTRIB)
- maTabs[i]->CopyConditionalFormat(nCol1, nRow1, nCol2, nRow2, nCol1 - aClipRange.aStart.Col(),
- nRow1 - aClipRange.aStart.Row(), pSrcTab);
+ for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
+ {
+ maTabs[i]->CopyConditionalFormat(nCol1, nRow, nCol2, nRow, nCol1 - aClipRange.aStart.Col(),
+ nRow - aClipRange.aStart.Row(), pSrcTab);
+ }
}
return true;
commit 30ee36473ccfb51009bb9d24b00d3a79895dd2ce
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Nov 29 18:22:38 2014 +0100
don't call XLSX methods in XLS export, related fdo#59762
This should fix a huge number of our xls export crashes. I just picked
my test document for the commit message. I suppose that nearly all
reported XLS export crashes are the same issue.
At the same time this should improve the performance of our XLS and XLSX
export a bit.
Change-Id: Id19e2515e75e10527d3af62d671377bec23f99e8
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index b7d5f36..521d1a9 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -1582,17 +1582,21 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) :
2) List is taken from A1 -> formula is =A1 -> writes tRefNR token
Formula compiler supports this by offering two different functions
CreateDataValFormula() and CreateListValFormula(). */
- mxTokArr1 = rFmlaComp.CreateFormula( EXC_FMLATYPE_LISTVAL, *xScTokArr );
- msFormula1 = XclXmlUtils::ToOUString( GetCompileFormulaContext(), pValData->GetSrcPos(),
+ if(GetOutput() == EXC_OUTPUT_BINARY)
+ mxTokArr1 = rFmlaComp.CreateFormula( EXC_FMLATYPE_LISTVAL, *xScTokArr );
+ else
+ msFormula1 = XclXmlUtils::ToOUString( GetCompileFormulaContext(), pValData->GetSrcPos(),
xScTokArr.get());
}
}
else
{
// no list validation -> convert the formula
- mxTokArr1 = rFmlaComp.CreateFormula( EXC_FMLATYPE_DATAVAL, *xScTokArr );
- msFormula1 = XclXmlUtils::ToOUString( GetCompileFormulaContext(), pValData->GetSrcPos(),
- xScTokArr.get());
+ if(GetOutput() == EXC_OUTPUT_BINARY)
+ mxTokArr1 = rFmlaComp.CreateFormula( EXC_FMLATYPE_DATAVAL, *xScTokArr );
+ else
+ msFormula1 = XclXmlUtils::ToOUString( GetCompileFormulaContext(), pValData->GetSrcPos(),
+ xScTokArr.get());
}
}
@@ -1600,9 +1604,11 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) :
xScTokArr.reset( pValData->CreateTokenArry( 1 ) );
if( xScTokArr.get() )
{
- mxTokArr2 = rFmlaComp.CreateFormula( EXC_FMLATYPE_DATAVAL, *xScTokArr );
- msFormula2 = XclXmlUtils::ToOUString( GetCompileFormulaContext(), pValData->GetSrcPos(),
- xScTokArr.get());
+ if(GetOutput() == EXC_OUTPUT_BINARY)
+ mxTokArr2 = rFmlaComp.CreateFormula( EXC_FMLATYPE_DATAVAL, *xScTokArr );
+ else
+ msFormula2 = XclXmlUtils::ToOUString( GetCompileFormulaContext(), pValData->GetSrcPos(),
+ xScTokArr.get());
}
}
else
commit 90716272658bf93518d0b9c6781a724c88fd5059
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Nov 29 17:58:54 2014 +0100
setting the document modified during import is insane
This helps with some huge documents and takes 90% of the time of the
import. The correct next step is to get rid of UNO in the calc style
import.
Change-Id: I6cbd315906405d8f438d99effad122af8edeb01d
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 8283657..6146a4a 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -704,7 +704,8 @@ void SAL_CALL ScStyleFamilyObj::insertByName( const OUString& aName, const uno::
pStyleObj->InitDoc( pDocShell, aNameStr ); // Objekt kann benutzt werden
- pDocShell->SetDocumentModified(); // verwendet wird der neue Style noch nicht
+ if (!rDoc.IsImportingXML())
+ pDocShell->SetDocumentModified(); // verwendet wird der neue Style noch nicht
bDone = true;
}
else
@@ -1103,8 +1104,11 @@ void SAL_CALL ScStyleObj::setParentStyle( const OUString& rParentStyle )
Fraction aZoom(1,1);
rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
- pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
- pDocShell->SetDocumentModified();
+ if (!rDoc.IsImportingXML())
+ {
+ pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
+ pDocShell->SetDocumentModified();
+ }
}
else
{
@@ -1467,8 +1471,11 @@ void SAL_CALL ScStyleObj::setAllPropertiesToDefault()
Fraction aZoom(1,1);
rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
- pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
- pDocShell->SetDocumentModified();
+ if (!rDoc.IsImportingXML())
+ {
+ pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
+ pDocShell->SetDocumentModified();
+ }
}
else
{
@@ -1846,8 +1853,11 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt
Fraction aZoom(1,1);
rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
- pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
- pDocShell->SetDocumentModified();
+ if (!rDoc.IsImportingXML())
+ {
+ pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
+ pDocShell->SetDocumentModified();
+ }
}
else
{
commit 6acfb0e75e1688d7af52a81dd070d97e5657ab4d
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Nov 29 02:19:30 2014 +0100
no need to declare variables before use
Change-Id: Ia732e283fa07ec5ece58e49dca2dcc5c61495109
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 6de9a58..cd97cdf 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -769,19 +769,18 @@ void OpenGLSalGraphicsImpl::DrawPolygon( sal_uInt32 nPoints, const SalPoint* pPt
void OpenGLSalGraphicsImpl::DrawPolyPolygon( const basegfx::B2DPolyPolygon& rPolyPolygon )
{
- sal_uInt32 i, j;
::std::vector< GLfloat > aVertices;
GLfloat nWidth = GetWidth();
GLfloat nHeight = GetHeight();
const ::basegfx::B2DPolyPolygon& aSimplePolyPolygon = ::basegfx::tools::solveCrossovers( rPolyPolygon );
- for( i = 0; i < aSimplePolyPolygon.count(); i++ )
+ for( sal_uInt32 i = 0; i < aSimplePolyPolygon.count(); i++ )
{
const basegfx::B2DPolygon& rPolygon( aSimplePolyPolygon.getB2DPolygon( i ) );
const ::basegfx::B2DPolygon& aResult(
::basegfx::triangulator::triangulate( rPolygon ) );
- for( j = 0; j < aResult.count(); j++ )
+ for( sal_uInt32 j = 0; j < aResult.count(); j++ )
{
const ::basegfx::B2DPoint& rPt( aResult.getB2DPoint( j ) );
aVertices.push_back( 2 * rPt.getX() / nWidth - 1.0f );
commit ae88bc4f53a7ad655e12dcbd932bed61ee6d8203
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Nov 29 02:18:42 2014 +0100
if we use hungarian notation let use it consistently
Change-Id: Ia17a5d983afb98e0b348909a66be85ea55f8a47a
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 295ac23..6de9a58 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -770,7 +770,7 @@ void OpenGLSalGraphicsImpl::DrawPolygon( sal_uInt32 nPoints, const SalPoint* pPt
void OpenGLSalGraphicsImpl::DrawPolyPolygon( const basegfx::B2DPolyPolygon& rPolyPolygon )
{
sal_uInt32 i, j;
- ::std::vector< GLfloat > pVertices;
+ ::std::vector< GLfloat > aVertices;
GLfloat nWidth = GetWidth();
GLfloat nHeight = GetHeight();
const ::basegfx::B2DPolyPolygon& aSimplePolyPolygon = ::basegfx::tools::solveCrossovers( rPolyPolygon );
@@ -784,14 +784,14 @@ void OpenGLSalGraphicsImpl::DrawPolyPolygon( const basegfx::B2DPolyPolygon& rPol
for( j = 0; j < aResult.count(); j++ )
{
const ::basegfx::B2DPoint& rPt( aResult.getB2DPoint( j ) );
- pVertices.push_back( 2 * rPt.getX() / nWidth - 1.0f );
- pVertices.push_back( 1.0f - 2 * rPt.getY() / nHeight );
+ aVertices.push_back( 2 * rPt.getX() / nWidth - 1.0f );
+ aVertices.push_back( 1.0f - 2 * rPt.getY() / nHeight );
}
}
glEnableVertexAttribArray( GL_ATTRIB_POS );
- glVertexAttribPointer( GL_ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, 0, pVertices.data() );
- glDrawArrays( GL_TRIANGLES, 0, pVertices.size() / 2 );
+ glVertexAttribPointer( GL_ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, 0, aVertices.data() );
+ glDrawArrays( GL_TRIANGLES, 0, aVertices.size() / 2 );
glDisableVertexAttribArray( GL_ATTRIB_POS );
CHECK_GL_ERROR();
commit b7d07ffcad2767013e1db5627b4a6d90f629e8ed
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Nov 29 02:16:41 2014 +0100
request also a stencil size
Change-Id: Ib3b8b70aa50dd1a42108e3e9091350bf1d315b03
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index d37fc7c..daee089 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -428,6 +428,7 @@ bool OpenGLHelper::GetVisualInfo(Display* pDisplay, int nScreen, XVisualInfo& rV
GLX_GREEN_SIZE, 8,
GLX_BLUE_SIZE, 8,
GLX_DEPTH_SIZE, 24,
+ GLX_STENCIL_SIZE, 8,
None };
pVI = glXChooseVisual( pDisplay, nScreen, aAttrib );
commit 5c887ab254bcd3d17ac16a2ec150c30fd2766fc7
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue Nov 25 18:03:12 2014 +0100
windows opengl: Transparency of the native widgets.
Change-Id: Ifa6ba5735582effc27ac68556c2367077705d1d6
diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx
index 7161dab..4c36bb3 100644
--- a/vcl/win/source/gdi/salgdi.cxx
+++ b/vcl/win/source/gdi/salgdi.cxx
@@ -610,7 +610,7 @@ OpenGLTexture* OpenGLCompatibleDC::getTexture()
return NULL;
// turn what's in the mpData into a texture
- return new OpenGLTexture(maRects.mnSrcWidth, maRects.mnSrcHeight, GL_RGBA, GL_UNSIGNED_BYTE, reinterpret_cast<sal_uInt8*>(mpData));
+ return new OpenGLTexture(maRects.mnSrcWidth, maRects.mnSrcHeight, GL_BGRA, GL_UNSIGNED_BYTE, reinterpret_cast<sal_uInt8*>(mpData));
}
WinSalGraphics::WinSalGraphics(WinSalGraphics::Type eType, bool bScreen, HWND hWnd):
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index 0789d4c..539af04 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -1297,7 +1297,7 @@ bool WinSalGraphics::drawNativeControl( ControlType nType,
return false;
pImpl->PreDraw();
- pImpl->DrawTexture(*pBlackTexture, aBlackDC.getTwoRect()); // FIXME combine the textures - DrawTextureSynthesizedAlpha()
+ pImpl->DrawTextureDiff(*pWhiteTexture, *pBlackTexture, aBlackDC.getTwoRect());
pImpl->PostDraw();
bOk = true;
commit 9ec885872b151f56b631292ea4f61c58341bc1b9
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue Nov 25 16:09:42 2014 +0100
windows opengl: We should actually use Init() from OpenGLSalGraphicsImpl.
Change-Id: I524883b0f0bbce9a8b6f893771f144feeee49934
diff --git a/vcl/inc/opengl/win/gdiimpl.hxx b/vcl/inc/opengl/win/gdiimpl.hxx
index 66a0333..de25d23 100644
--- a/vcl/inc/opengl/win/gdiimpl.hxx
+++ b/vcl/inc/opengl/win/gdiimpl.hxx
@@ -26,8 +26,6 @@ private:
public:
WinOpenGLSalGraphicsImpl(WinSalGraphics& rGraphics);
- virtual void Init() SAL_OVERRIDE;
-
protected:
virtual GLfloat GetWidth() const SAL_OVERRIDE;
virtual GLfloat GetHeight() const SAL_OVERRIDE;
diff --git a/vcl/opengl/win/gdiimpl.cxx b/vcl/opengl/win/gdiimpl.cxx
index ebd139c..0815927 100644
--- a/vcl/opengl/win/gdiimpl.cxx
+++ b/vcl/opengl/win/gdiimpl.cxx
@@ -18,15 +18,6 @@ WinOpenGLSalGraphicsImpl::WinOpenGLSalGraphicsImpl(WinSalGraphics& rGraphics):
{
}
-void WinOpenGLSalGraphicsImpl::Init()
-{
- // FIXME - is this still needed after the recent changes?
- //if (mbVirDev)
- // GetOpenGLContext().requestVirtualDevice();
- //GetOpenGLContext().requestSingleBufferedRendering();
- //GetOpenGLContext().init(mhLocalDC, mhWnd);
-}
-
void WinOpenGLSalGraphicsImpl::copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics )
{
OpenGLSalGraphicsImpl *pImpl = pSrcGraphics ? static_cast< OpenGLSalGraphicsImpl* >(pSrcGraphics->GetImpl()) : static_cast< OpenGLSalGraphicsImpl *>(mrParent.GetImpl());
diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx
index 05279d1..7161dab 100644
--- a/vcl/win/source/gdi/salgdi.cxx
+++ b/vcl/win/source/gdi/salgdi.cxx
@@ -482,6 +482,7 @@ void WinSalGraphics::InitGraphics()
::SetTextAlign( getHDC(), TA_BASELINE | TA_LEFT | TA_NOUPDATECP );
::SetBkMode( getHDC(), WIN32_TRANSPARENT );
::SetROP2( getHDC(), R2_COPYPEN );
+
mpImpl->Init();
}
More information about the Libreoffice-commits
mailing list