Kaydet (Commit) 5d1ab099 authored tarafından Noel Grandin's avatar Noel Grandin

tdf#66668 - FILESAVE: Saving an XLSX file freezes Calc

Change-Id: I7abbb1cc5056f33458257afe28ed933e2d3c378d
(cherry picked from commit 343e405f)
üst 3d5f762b
...@@ -693,7 +693,7 @@ public: ...@@ -693,7 +693,7 @@ public:
void SetPendingRowHeights( SCTAB nTab, bool bSet ); void SetPendingRowHeights( SCTAB nTab, bool bSet );
SC_DLLPUBLIC void SetLayoutRTL( SCTAB nTab, bool bRTL ); SC_DLLPUBLIC void SetLayoutRTL( SCTAB nTab, bool bRTL );
SC_DLLPUBLIC bool IsLayoutRTL( SCTAB nTab ) const; SC_DLLPUBLIC bool IsLayoutRTL( SCTAB nTab ) const;
bool IsNegativePage( SCTAB nTab ) const; SC_DLLPUBLIC bool IsNegativePage( SCTAB nTab ) const;
SC_DLLPUBLIC void SetScenario( SCTAB nTab, bool bFlag ); SC_DLLPUBLIC void SetScenario( SCTAB nTab, bool bFlag );
SC_DLLPUBLIC bool IsScenario( SCTAB nTab ) const; SC_DLLPUBLIC bool IsScenario( SCTAB nTab ) const;
SC_DLLPUBLIC void GetScenarioData( SCTAB nTab, OUString& rComment, SC_DLLPUBLIC void GetScenarioData( SCTAB nTab, OUString& rComment,
......
...@@ -159,15 +159,15 @@ static void lcl_WriteAnchorVertex( sax_fastparser::FSHelperPtr rComments, Rectan ...@@ -159,15 +159,15 @@ static void lcl_WriteAnchorVertex( sax_fastparser::FSHelperPtr rComments, Rectan
static void lcl_GetFromTo( const XclExpRoot& rRoot, const Rectangle &aRect, sal_Int32 nTab, Rectangle &aFrom, Rectangle &aTo ) static void lcl_GetFromTo( const XclExpRoot& rRoot, const Rectangle &aRect, sal_Int32 nTab, Rectangle &aFrom, Rectangle &aTo )
{ {
bool bTo = false;
sal_Int32 nCol = 0, nRow = 0; sal_Int32 nCol = 0, nRow = 0;
sal_Int32 nColOff = 0, nRowOff= 0; sal_Int32 nColOff = 0, nRowOff= 0;
while(true) const bool bRTL = rRoot.GetDocRef().IsNegativePage( nTab );
if (!bRTL)
{ {
Rectangle r = rRoot.GetDocRef().GetMMRect( nCol,nRow,nCol,nRow,nTab ); while(true)
if( !bTo )
{ {
Rectangle r = rRoot.GetDocRef().GetMMRect( nCol,nRow,nCol,nRow,nTab );
if( r.Left() <= aRect.Left() ) if( r.Left() <= aRect.Left() )
{ {
nCol++; nCol++;
...@@ -182,11 +182,38 @@ static void lcl_GetFromTo( const XclExpRoot& rRoot, const Rectangle &aRect, sal_ ...@@ -182,11 +182,38 @@ static void lcl_GetFromTo( const XclExpRoot& rRoot, const Rectangle &aRect, sal_
{ {
aFrom = Rectangle( nCol-1, static_cast<long>(HMM2XL( nColOff )), aFrom = Rectangle( nCol-1, static_cast<long>(HMM2XL( nColOff )),
nRow-1, static_cast<long>(HMM2XL( nRowOff )) ); nRow-1, static_cast<long>(HMM2XL( nRowOff )) );
bTo=true; break;
} }
} }
if( bTo ) }
else
{
while(true)
{ {
Rectangle r = rRoot.GetDocRef().GetMMRect( nCol,nRow,nCol,nRow,nTab );
if( r.Left() >= aRect.Left() )
{
nCol++;
nColOff = r.Left() - aRect.Left();
}
if( r.Top() <= aRect.Top() )
{
nRow++;
nRowOff = aRect.Top() - r.Top();
}
if( r.Left() < aRect.Left() && r.Top() > aRect.Top() )
{
aFrom = Rectangle( nCol-1, static_cast<long>(HMM2XL( nColOff )),
nRow-1, static_cast<long>(HMM2XL( nRowOff )) );
break;
}
}
}
if (!bRTL)
{
while(true)
{
Rectangle r = rRoot.GetDocRef().GetMMRect( nCol,nRow,nCol,nRow,nTab );
if( r.Right() < aRect.Right() ) if( r.Right() < aRect.Right() )
nCol++; nCol++;
if( r.Bottom() < aRect.Bottom() ) if( r.Bottom() < aRect.Bottom() )
...@@ -199,7 +226,23 @@ static void lcl_GetFromTo( const XclExpRoot& rRoot, const Rectangle &aRect, sal_ ...@@ -199,7 +226,23 @@ static void lcl_GetFromTo( const XclExpRoot& rRoot, const Rectangle &aRect, sal_
} }
} }
} }
return; else
{
while(true)
{
Rectangle r = rRoot.GetDocRef().GetMMRect( nCol,nRow,nCol,nRow,nTab );
if( r.Right() >= aRect.Right() )
nCol++;
if( r.Bottom() < aRect.Bottom() )
nRow++;
if( r.Right() < aRect.Right() && r.Bottom() >= aRect.Bottom() )
{
aTo = Rectangle( nCol, static_cast<long>(HMM2XL( r.Left() - aRect.Right() )),
nRow, static_cast<long>(HMM2XL( aRect.Bottom() - r.Top() )));
break;
}
}
}
} }
// Escher client anchor ======================================================= // Escher client anchor =======================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment