[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-04-18 Thread Petr Mladek
 sc/source/core/data/table6.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4bd76b74c0145635ef69caa94e3235f6ce3ab5de
Author: David Tardon dtar...@redhat.com
Date:   Wed Apr 18 09:44:19 2012 +0200

fdo#44861 make Replace All work with REs

Signed-off-by: Petr Mladek pmla...@suse.cz

diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index 55ac066..44c5ecc 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -207,13 +207,13 @@ bool ScTable::SearchCell(const SvxSearchItem 
rSearchItem, SCCOL nCol, SCROW nRo
 else if (bDoBack)
 {
 xub_StrLen nTemp=nStart; nStart=nEnd; nEnd=nTemp;
-bRepeat = ((bool)(pSearchText-SearchBkwrd(aString, 
nStart, nEnd)));
+bRepeat = ((bool)(pSearchText-SearchBkwrd(aString, 
nStart, nEnd, aSearchResult)));
 // change results to definition before 614:
 --nEnd;
 }
 else
 {
-bRepeat = ((bool)(pSearchText-SearchFrwrd(aString, 
nStart, nEnd)));
+bRepeat = ((bool)(pSearchText-SearchFrwrd(aString, 
nStart, nEnd, aSearchResult)));
 // change results to definition before 614:
 --nEnd;
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-04-17 Thread Petr Mladek
 sc/source/ui/inc/output.hxx   |2 -
 sc/source/ui/view/output2.cxx |   59 --
 2 files changed, 35 insertions(+), 26 deletions(-)

New commits:
commit 7a028f6c1e7fb80a22002ad6fed1604dab327e36
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Mon Apr 16 22:02:12 2012 -0400

fdo#48431: More reliable way to check for RTL text.

This is probably more reliable way to fix fdo#32530 such that it won't
cause the regression in rendering Thai texts as reported in fdo#48431.

Signed-off-by: Petr Mladek pmla...@suse.cz

diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
index 9a81555..5bdb101 100644
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
@@ -102,12 +102,12 @@ private:
 longmnPosX;
 longmnPosY;
 longmnInitPosX;
-sal_uInt8   mnScript;
 boolmbBreak;
 boolmbCellIsValue;
 boolmbAsianVertical;
 boolmbPixelToLogic;
 boolmbHyphenatorSet;
+boolmbRTL;
 ScFieldEditEngine*  mpEngine;
 ScBaseCell* mpCell;
 const ScPatternAttr*mpPattern;
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 82a9905..7f9a9eb 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -70,10 +70,14 @@
 #include scmod.hxx
 #include fillinfo.hxx
 
+#include com/sun/star/i18n/DirectionProperty.hpp
+
 #include boost/ptr_container/ptr_vector.hpp
 
 #include math.h
 
+using namespace com::sun::star;
+
 //! Autofilter-Breite mit column.cxx zusammenfassen
 #define DROPDOWN_BITMAP_SIZE18
 
@@ -1330,6 +1334,29 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE 
nArrY, long nPosX, long nPosY
 rParam.maClipRect.Justify();
 }
 
+namespace {
+
+bool beginsWithRTLCharacter(const rtl::OUString rStr)
+{
+if (rStr.isEmpty())
+return false;
+
+switch (ScGlobal::pCharClass-getCharacterDirection(rStr, 0))
+{
+case i18n::DirectionProperty_RIGHT_TO_LEFT:
+case i18n::DirectionProperty_RIGHT_TO_LEFT_ARABIC:
+case i18n::DirectionProperty_RIGHT_TO_LEFT_EMBEDDING:
+case i18n::DirectionProperty_RIGHT_TO_LEFT_OVERRIDE:
+return true;
+default:
+;
+}
+
+return false;
+}
+
+}
+
 void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
 {
 OSL_ENSURE( pDev == pRefDevice ||
@@ -1564,18 +1591,8 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
 if (aVars.GetHorJust() == SVX_HOR_JUSTIFY_STANDARD)
 {
 // fdo#32530: Default alignment depends on value vs
-// string, and the script type of the 1st letter.
-sal_uInt8 nScript1st = 0;
-rtl::OUString aStr = aVars.GetString();
-if (!aStr.isEmpty())
-{
-aStr = aStr.copy(0, 1);
-nScript1st = pDoc-GetStringScriptType(aStr);
-if (!nScript1st)
-nScript1st = ScGlobal::GetDefaultScriptType();
-}
-
-if (nScript1st == SCRIPTTYPE_COMPLEX)
+// string, and the direction of the 1st letter.
+if (beginsWithRTLCharacter(aVars.GetString()))
 eOutHorJust = bCellIsValue ? SVX_HOR_JUSTIFY_LEFT 
: SVX_HOR_JUSTIFY_RIGHT;
 else
 eOutHorJust = bCellIsValue ? SVX_HOR_JUSTIFY_RIGHT 
: SVX_HOR_JUSTIFY_LEFT;
@@ -2155,12 +2172,12 @@ ScOutputData::DrawEditParam::DrawEditParam(const 
ScPatternAttr* pPattern, const
 mnArrY(0),
 mnX(0), mnY(0), mnCellX(0), mnCellY(0),
 mnPosX(0), mnPosY(0), mnInitPosX(0),
-mnScript(0),
 mbBreak( (meHorJust == SVX_HOR_JUSTIFY_BLOCK) || 
lcl_GetBoolValue(*pPattern, ATTR_LINEBREAK, pCondSet) ),
 mbCellIsValue(bCellIsValue),
 mbAsianVertical(false),
 mbPixelToLogic(false),
 mbHyphenatorSet(false),
+mbRTL(false),
 mpEngine(NULL),
 mpCell(NULL),
 mpPattern(pPattern),
@@ -2590,8 +2607,8 @@ void ScOutputData::DrawEditStandard(DrawEditParam rParam)
 if (eOutHorJust == SVX_HOR_JUSTIFY_STANDARD)
 {
 // fdo#32530: Default alignment depends on value vs string, and the
-// script type of the 1st letter.
-if (rParam.mnScript == SCRIPTTYPE_COMPLEX)
+// direction of the 1st letter.
+if (rParam.mbRTL)
 eOutHorJust = rParam.mbCellIsValue ? SVX_HOR_JUSTIFY_LEFT : 
SVX_HOR_JUSTIFY_RIGHT;
 else
 eOutHorJust = rParam.mbCellIsValue ? SVX_HOR_JUSTIFY_RIGHT : 

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-04-17 Thread Kohei Yoshida
 sc/source/ui/unoobj/datauno.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5920b681eaf2f1203efd5af581827db2e1a81bc8
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Wed Apr 18 03:38:08 2012 +0900

fdo#46983 Macros: Macro to set filter in Calc does not work with 
.StringValue

this fixed a regression slipped into 
8808d77f199720be596a09084fbc36569ed2f1f1

Signed-off-by: Kohei Yoshida kohei.yosh...@gmail.com

diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 3695f14..69252ed 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -1334,7 +1334,7 @@ throw(uno::RuntimeException)
 if (!bByEmpty  !rEntry.GetQueryItems().empty())
 {
 const ScQueryEntry::Item rItem = rEntry.GetQueryItems().front();
-aField.IsNumeric = !rItem.meType != ScQueryEntry::ByString;
+aField.IsNumeric = rItem.meType != ScQueryEntry::ByString;
 aField.StringValue   = rItem.maString;
 aField.NumericValue  = rItem.mfVal;
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-04-17 Thread Kohei Yoshida
 sc/source/ui/inc/mvtabdlg.hxx  |2 ++
 sc/source/ui/miscdlgs/mvtabdlg.cxx |   27 +--
 2 files changed, 19 insertions(+), 10 deletions(-)

New commits:
commit 05579aa8b26f593af650d8434ff1c25c0a2702a6
Author: Eike Rathke er...@redhat.com
Date:   Tue Apr 17 20:57:34 2012 +0200

resolved rhbz#813280 the current document is not always the first in list

i.e. if more than one document open and dialog invoked on any but the first
document.

Signed-off-by: Kohei Yoshida kohei.yosh...@gmail.com

diff --git a/sc/source/ui/inc/mvtabdlg.hxx b/sc/source/ui/inc/mvtabdlg.hxx
index c53a59f..f9c63a3 100644
--- a/sc/source/ui/inc/mvtabdlg.hxx
+++ b/sc/source/ui/inc/mvtabdlg.hxx
@@ -58,6 +58,7 @@ private:
 void ResetRenameInput();
 void CheckNewTabName();
 ScDocument* GetSelectedDoc();
+bool IsCurrentDocSelected() const;
 
 private:
 FixedLine   aFlAction;
@@ -82,6 +83,7 @@ private:
 
 const rtl::OUString maDefaultName;
 
+sal_uInt16  mnCurrentDocPos;
 sal_uInt16  nDocument;
 SCTAB   nTable;
 boolbCopyTable:1;
diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx 
b/sc/source/ui/miscdlgs/mvtabdlg.cxx
index 831905d..ffe96af 100644
--- a/sc/source/ui/miscdlgs/mvtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx
@@ -70,6 +70,7 @@ ScMoveTableDlg::ScMoveTableDlg(Window* pParent, const 
rtl::OUString rDefault)
 maStrTabNameInvalid( 
ResId::toString(ScResId(STR_TABNAME_WARN_INVALID)) ),
 //
 maDefaultName( rDefault ),
+mnCurrentDocPos( 0 ),
 nDocument   ( 0 ),
 nTable  ( 0 ),
 bCopyTable  ( false ),
@@ -127,8 +128,13 @@ void ScMoveTableDlg::EnableRenameTable(sal_Bool bFlag)
 void ScMoveTableDlg::ResetRenameInput()
 {
 if (mbEverEdited)
+{
 // Don't reset the name when the sheet name has ever been edited.
+// But check the name, as this is also called for change of copy/move
+// buttons and document listbox selection.
+CheckNewTabName();
 return;
+}
 
 if (!aEdTabName.IsEnabled())
 {
@@ -178,19 +184,15 @@ void ScMoveTableDlg::CheckNewTabName()
 return;
 }
 
-bool   bFound = false;
+bool bMoveInCurrentDoc = (aBtnMove.IsChecked()  IsCurrentDocSelected());
+bool bFound = false;
 sal_uInt16 nLast  = aLbTable.GetEntryCount() - 1;
-for ( sal_uInt16 i=0; i=nLast; ++i )
+for ( sal_uInt16 i=0; i=nLast  !bFound; ++i )
 {
 if ( aNewName.equals(aLbTable.GetEntry(i)) )
 {
-if (aBtnMove.IsChecked() 
-aLbDoc.GetSelectEntryPos() == 0 
-maDefaultName.equals(aEdTabName.GetText()))
-
-// Move inside same document, thus same name is allowed.
-bFound = false;
-else
+// Only for move within same document the same name is allowed.
+if (!bMoveInCurrentDoc || !maDefaultName.equals( 
aEdTabName.GetText()))
 bFound = true;
 }
 }
@@ -214,6 +216,11 @@ ScDocument* ScMoveTableDlg::GetSelectedDoc()
 return static_castScDocument*(aLbDoc.GetEntryData(nPos));
 }
 
+bool ScMoveTableDlg::IsCurrentDocSelected() const
+{
+return aLbDoc.GetSelectEntryPos() == mnCurrentDocPos;
+}
+
 //
 
 void ScMoveTableDlg::Init()
@@ -254,7 +261,7 @@ void ScMoveTableDlg::InitDocListBox()
 
 if ( pScSh == SfxObjectShell::Current() )
 {
-nSelPos = i;
+mnCurrentDocPos = nSelPos = i;
 aEntryName += sal_Unicode( ' ' );
 aEntryName += String( ScResId( STR_CURRENTDOC ) );
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-04-02 Thread Kohei Yoshida
 sc/source/core/data/docpool.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 643fd5a6d2f72e55b243290b85be25f77dcf7be8
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Apr 2 17:23:46 2012 +0200

this hack in no longer needed, fdo#44337

excel import now uses the stored row height and we should go back to a
symetric default margin

Signed-off-by: Kohei Yoshida kohei.yosh...@gmail.com

diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index 3061856..36f0d3b 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -275,10 +275,7 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, 
sal_Bool bLoadRefCounts )
 ppPoolDefaults[ ATTR_SHRINKTOFIT - ATTR_STARTINDEX ] = new 
SfxBoolItem( ATTR_SHRINKTOFIT );
 ppPoolDefaults[ ATTR_BORDER_TLBR - ATTR_STARTINDEX ] = new 
SvxLineItem( ATTR_BORDER_TLBR );
 ppPoolDefaults[ ATTR_BORDER_BLTR - ATTR_STARTINDEX ] = new 
SvxLineItem( ATTR_BORDER_BLTR );
-SvxMarginItem* pItem = new SvxMarginItem( ATTR_MARGIN );
-pItem-SetTopMargin( 27 );
-pItem-SetBottomMargin( 27 );
-ppPoolDefaults[ ATTR_MARGIN  - ATTR_STARTINDEX ] = pItem;
+ppPoolDefaults[ ATTR_MARGIN  - ATTR_STARTINDEX ] = new 
SvxMarginItem( ATTR_MARGIN );
 ppPoolDefaults[ ATTR_MERGE   - ATTR_STARTINDEX ] = new ScMergeAttr;
 ppPoolDefaults[ ATTR_MERGE_FLAG  - ATTR_STARTINDEX ] = new 
ScMergeFlagAttr;
 ppPoolDefaults[ ATTR_VALUE_FORMAT- ATTR_STARTINDEX ] = new 
SfxUInt32Item( ATTR_VALUE_FORMAT, 0 );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-04-02 Thread Kohei Yoshida
 sc/source/filter/excel/xestyle.cxx |8 
 sc/source/filter/excel/xistyle.cxx |   37 +++--
 sc/source/filter/inc/xlconst.hxx   |   10 ++
 3 files changed, 29 insertions(+), 26 deletions(-)

New commits:
commit 487139d681fbf38a52cf5ea91d7e38f7eba290a0
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Apr 1 23:57:46 2012 +0200

use same border width information for xls import and export, fdo#44742

Signed-off-by: Kohei Yoshida kohei.yosh...@gmail.com

diff --git a/sc/source/filter/excel/xestyle.cxx 
b/sc/source/filter/excel/xestyle.cxx
index 11757bb..39ecfcf 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1553,15 +1553,15 @@ void lclGetBorderLine(
 sal_uInt16 nDistance = pLine-GetDistance();
 if( nDistance  0 )
 rnXclLine = EXC_LINE_DOUBLE;
-else if( nOuterWidth  DEF_LINE_WIDTH_2 )
+else if( nOuterWidth = EXC_BORDER_THICK )
 rnXclLine = EXC_LINE_THICK;
-else if( nOuterWidth  DEF_LINE_WIDTH_1 )
+else if( nOuterWidth = EXC_BORDER_MEDIUM )
 {
 rnXclLine = EXC_LINE_MEDIUM;
 if ( pLine-GetStyle( ) == ::editeng::DASHED )
 rnXclLine = EXC_LINE_MEDIUMDASHED;
 }
-else if( nOuterWidth  DEF_LINE_WIDTH_0 )
+else if( nOuterWidth = EXC_BORDER_THIN )
 {
 rnXclLine = EXC_LINE_THIN;
 switch ( pLine-GetStyle( ) )
@@ -1576,7 +1576,7 @@ void lclGetBorderLine(
 break;
 }
 }
-else if( nOuterWidth  0 )
+else if( nOuterWidth = EXC_BORDER_HAIR )
 rnXclLine = EXC_LINE_HAIR;
 else
 rnXclLine = EXC_LINE_NONE;
diff --git a/sc/source/filter/excel/xistyle.cxx 
b/sc/source/filter/excel/xistyle.cxx
index 2131095..1f55f2d 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -890,33 +890,26 @@ bool XclImpCellBorder::HasAnyOuterBorder() const
 
 namespace {
 
-// TODO: These values are approximate; we should probably tweak these values
-// further to better match Excel's border thickness.
-#define XLS_LINE_WIDTH_HAIR1
-#define XLS_LINE_WIDTH_THIN6
-#define XLS_LINE_WIDTH_MEDIUM 18
-#define XLS_LINE_WIDTH_THICK  24
-
 /** Converts the passed line style to a ::editeng::SvxBorderLine, or returns 
false, if style is no line. */
 bool lclConvertBorderLine( ::editeng::SvxBorderLine rLine, const 
XclImpPalette rPalette, sal_uInt8 nXclLine, sal_uInt16 nXclColor )
 {
 static const sal_uInt16 ppnLineParam[][ 4 ] =
 {
-//  outer width,   type
-{   0, ::editeng::SOLID },// 0 = 
none
-{   XLS_LINE_WIDTH_THIN,   ::editeng::SOLID },// 1 = 
thin
-{   XLS_LINE_WIDTH_MEDIUM, ::editeng::SOLID },// 2 = 
medium
-{   XLS_LINE_WIDTH_THIN,   ::editeng::DASHED },   // 3 = 
dashed
-{   XLS_LINE_WIDTH_THIN,   ::editeng::DOTTED },   // 4 = 
dotted
-{   XLS_LINE_WIDTH_THICK,  ::editeng::SOLID },// 5 = 
thick
-{   XLS_LINE_WIDTH_THIN,   ::editeng::DOUBLE }, // 6 = 
double
-{   XLS_LINE_WIDTH_HAIR,   ::editeng::SOLID },// 7 = 
hair
-{   XLS_LINE_WIDTH_MEDIUM, ::editeng::DASHED },   // 8 = 
med dash
-{   XLS_LINE_WIDTH_THIN,   ::editeng::SOLID },// 9 = 
thin dashdot
-{   XLS_LINE_WIDTH_MEDIUM, ::editeng::SOLID },// A = 
med dashdot
-{   XLS_LINE_WIDTH_THIN,   ::editeng::SOLID },// B = 
thin dashdotdot
-{   XLS_LINE_WIDTH_MEDIUM, ::editeng::SOLID },// C = 
med dashdotdot
-{   XLS_LINE_WIDTH_MEDIUM, ::editeng::SOLID } // D = 
med slant dashdot
+//  outer width,type
+{   0,  ::editeng::SOLID },// 0 = none
+{   EXC_BORDER_THIN,::editeng::SOLID },// 1 = thin
+{   EXC_BORDER_MEDIUM,  ::editeng::SOLID },// 2 = 
medium
+{   EXC_BORDER_THIN,::editeng::DASHED },   // 3 = 
dashed
+{   EXC_BORDER_THIN,::editeng::DOTTED },   // 4 = 
dotted
+{   EXC_BORDER_THICK,   ::editeng::SOLID },// 5 = thick
+{   EXC_BORDER_THIN,::editeng::DOUBLE }, // 6 = 
double
+{   EXC_BORDER_HAIR,::editeng::SOLID },// 7 = hair
+{   EXC_BORDER_MEDIUM,  ::editeng::DASHED },   // 8 = med 
dash
+{   EXC_BORDER_THIN,::editeng::SOLID },// 9 = thin 
dashdot
+{   EXC_BORDER_MEDIUM,  ::editeng::SOLID },// A = med 
dashdot
+{   EXC_BORDER_THIN,::editeng::SOLID },// B = thin 
dashdotdot
+{   

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-26 Thread Michael Meeks
 sc/source/ui/cctrl/checklistmenu.cxx  |2 ++
 sc/source/ui/namedlg/namemgrtable.cxx |2 ++
 2 files changed, 4 insertions(+)

New commits:
commit 801c5d5b88454f659a08d9a4940b90499bec9584
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Mar 26 04:58:47 2012 +0200

prevent update during init in new autofilter dlg, fdo#45679

Signed-off-by: Michael Meeks michael.me...@suse.com

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index 9b23197..d269333 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1164,6 +1164,7 @@ void ScCheckListMenuWindow::initMembers()
 {
 size_t n = maMembers.size();
 size_t nVisMemCount = 0;
+maChecks.SetUpdateMode(false);
 for (size_t i = 0; i  n; ++i)
 {
 maChecks.InsertEntry(maMembers[i].maName);
@@ -1188,6 +1189,7 @@ void ScCheckListMenuWindow::initMembers()
 maChkToggleAll.SetState(STATE_DONTKNOW);
 mePrevToggleAllState = STATE_DONTKNOW;
 }
+maChecks.SetUpdateMode(true);
 }
 
 void ScCheckListMenuWindow::setConfig(const Config rConfig)
diff --git a/sc/source/ui/namedlg/namemgrtable.cxx 
b/sc/source/ui/namedlg/namemgrtable.cxx
index b9164d3..5a02130 100644
--- a/sc/source/ui/namedlg/namemgrtable.cxx
+++ b/sc/source/ui/namedlg/namemgrtable.cxx
@@ -127,6 +127,7 @@ void ScRangeManagerTable::GetLine(ScRangeNameLine rLine, 
SvLBoxEntry* pEntry)
 
 void ScRangeManagerTable::Init()
 {
+SetUpdateMode(false);
 Clear();
 for (boost::ptr_maprtl::OUString, ScRangeName::const_iterator itr = 
mrRangeMap.begin();
 itr != mrRangeMap.end(); ++itr)
@@ -147,6 +148,7 @@ void ScRangeManagerTable::Init()
 }
 }
 }
+SetUpdateMode(true);
 }
 
 const ScRangeData* ScRangeManagerTable::findRangeData(const ScRangeNameLine 
rLine)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-23 Thread Kohei Yoshida
 sc/source/filter/html/htmlexp.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 2ccb55183e1131039f062abbbd95caf1451c5efe
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 23 04:27:45 2012 +0100

increase nCol before next iteratation to prevent loop, fdo#46220

Signed-off-by: Kohei Yoshida kohei.yosh...@gmail.com

diff --git a/sc/source/filter/html/htmlexp.cxx 
b/sc/source/filter/html/htmlexp.cxx
index 0e8fee9..16f4826 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -777,7 +777,11 @@ void ScHTMLExport::WriteTables()
 while( nCol = nEndCol )
 {
 if( pDoc-ColHidden(nCol, nTab) )
+{
+++nCol;
 continue;
+}
+
 if( nWidth != ToPixel( pDoc-GetColWidth( nCol, nTab ) ) )
 {
 if( nSpan != 0 )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-23 Thread Kohei Yoshida
 sc/source/core/tool/scmatrix.cxx |   33 -
 1 file changed, 16 insertions(+), 17 deletions(-)

New commits:
commit 9e00196c1a59eef1889f561e2c9891fdc280a333
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 23 02:05:36 2012 +0100

cache calls to mdds:mixed_type_matrix::size, related fdo#47299

Signed-off-by: Kohei Yoshida kohei.yosh...@gmail.com

diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index 71d8114..7137f90 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -170,6 +170,7 @@ class ScMatrixImpl
 ScMatrix::DensityType meType;
 ScInterpreter* pErrorInterpreter;
 boolmbCloneIfConst; // Whether the matrix is cloned with a 
CloneIfConst() call.
+MatrixImplType::size_pair_type  maCachedSize;
 
 ScMatrixImpl();
 ScMatrixImpl(const ScMatrixImpl);
@@ -244,6 +245,7 @@ ScMatrixImpl::ScMatrixImpl(SCSIZE nC, SCSIZE nR, 
ScMatrix::DensityType eType) :
 pErrorInterpreter(NULL),
 mbCloneIfConst(true)
 {
+maCachedSize = maMat.size();
 }
 
 ScMatrixImpl::~ScMatrixImpl()
@@ -254,6 +256,7 @@ ScMatrixImpl::~ScMatrixImpl()
 void ScMatrixImpl::Clear()
 {
 maMat.clear();
+maCachedSize = maMat.size();
 }
 
 void ScMatrixImpl::SetImmutable(bool bVal)
@@ -269,6 +272,7 @@ bool ScMatrixImpl::IsImmutable() const
 void ScMatrixImpl::Resize(SCSIZE nC, SCSIZE nR)
 {
 maMat.resize(nR, nC);
+maCachedSize = maMat.size();
 }
 
 ScMatrix::DensityType ScMatrixImpl::GetDensityType() const
@@ -283,21 +287,18 @@ void ScMatrixImpl::SetErrorInterpreter( ScInterpreter* p)
 
 void ScMatrixImpl::GetDimensions( SCSIZE rC, SCSIZE rR) const
 {
-MatrixImplType::size_pair_type aDims = maMat.size();
-rR = aDims.first;
-rC = aDims.second;
+rR = maCachedSize.first;
+rC = maCachedSize.second;
 }
 
 SCSIZE ScMatrixImpl::GetElementCount() const
 {
-MatrixImplType::size_pair_type aDims = maMat.size();
-return aDims.first * aDims.second;
+return maCachedSize.first * maCachedSize.second;
 }
 
 bool ScMatrixImpl::ValidColRow( SCSIZE nC, SCSIZE nR) const
 {
-MatrixImplType::size_pair_type aDims = maMat.size();
-return nR  aDims.first  nC  aDims.second;
+return nR  maCachedSize.first  nC  maCachedSize.second;
 }
 
 SCSIZE ScMatrixImpl::CalcOffset( SCSIZE nC, SCSIZE nR) const
@@ -307,21 +308,19 @@ SCSIZE ScMatrixImpl::CalcOffset( SCSIZE nC, SCSIZE nR) 
const
 
 bool ScMatrixImpl::ValidColRowReplicated( SCSIZE  rC, SCSIZE  rR ) const
 {
-pairsize_t, size_t aDims = maMat.size();
-
-if (aDims.second == 1  aDims.first == 1)
+if (maCachedSize.second == 1  maCachedSize.first == 1)
 {
 rC = 0;
 rR = 0;
 return true;
 }
-else if (aDims.second == 1  rR  aDims.first)
+else if (maCachedSize.second == 1  rR  maCachedSize.first)
 {
 // single column matrix.
 rC = 0;
 return true;
 }
-else if (aDims.first == 1  rC  aDims.second)
+else if (maCachedSize.first == 1  rC  maCachedSize.second)
 {
 // single row matrix.
 rR = 0;
@@ -645,8 +644,7 @@ bool ScMatrixImpl::IsNumeric() const
 
 void ScMatrixImpl::MatCopy(ScMatrixImpl mRes) const
 {
-MatrixImplType::size_pair_type s1 = maMat.size(), s2 = mRes.maMat.size();
-if (s1.first  s2.first || s1.second  s2.second)
+if (maCachedSize.first  mRes.maCachedSize.first || maCachedSize.second  
mRes.maCachedSize.second)
 {
 // destination matrix is not large enough.
 OSL_FAIL(ScMatrixImpl::MatCopy: dimension error);
@@ -654,12 +652,14 @@ void ScMatrixImpl::MatCopy(ScMatrixImpl mRes) const
 }
 
 mRes.maMat.assign(maMat);
+mRes.maCachedSize = mRes.maMat.size();
 }
 
 void ScMatrixImpl::MatTrans(ScMatrixImpl mRes) const
 {
 mRes.maMat = maMat;
 mRes.maMat.transpose();
+mRes.maCachedSize = mRes.maMat.size();
 }
 
 void ScMatrixImpl::FillDouble( double fVal, SCSIZE nC1, SCSIZE nR1, SCSIZE 
nC2, SCSIZE nR2 )
@@ -726,8 +726,7 @@ template typename _Evaluator
 bool EvalMatrix(const MatrixImplType rMat)
 {
 _Evaluator aEval;
-pairsize_t,size_t aDim = rMat.size();
-size_t nRows = aDim.first, nCols = aDim.second;
+size_t nRows = rMat.size().first, nCols = rMat.size().second;
 for (size_t i = 0; i  nRows; ++i)
 {
 for (size_t j = 0; j  nCols; ++j)
@@ -917,7 +916,7 @@ size_t ScMatrixImpl::Count(bool bCountStrings) const
 
 void ScMatrixImpl::CalcPosition(SCSIZE nIndex, SCSIZE rC, SCSIZE rR) const
 {
-SCSIZE nRowSize = maMat.size().first;
+SCSIZE nRowSize = maCachedSize.first;
 rC = nIndex / nRowSize;
 rR = nIndex - rC*nRowSize;
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-20 Thread Petr Mladek
 sc/source/core/data/documen5.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f24545a72cf43d0852c4f8edae0b3a9919120cdd
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Mar 19 20:59:01 2012 +0100

check for negative sheet number here too, fdo#47503

Signed-off-by: Petr Mladek pmla...@suse.cz

diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx
index f19a067..7b83b53 100644
--- a/sc/source/core/data/documen5.cxx
+++ b/sc/source/core/data/documen5.cxx
@@ -636,7 +636,7 @@ void ScDocument::SetChartRangeList( const rtl::OUString 
rChartName,
 
 bool ScDocument::HasData( SCCOL nCol, SCROW nRow, SCTAB nTab )
 {
-if (nTab  static_castSCTAB(maTabs.size())  maTabs[nTab])
+if ( VALIDTAB(nTab)  nTab  static_castSCTAB(maTabs.size())  
maTabs[nTab])
 return maTabs[nTab]-HasData( nCol, nRow );
 else
 return false;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-19 Thread Tor Lillqvist
 sc/source/ui/app/transobj.cxx |   15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 39228c6d2419636be04ee4a320a7c0ca08276f37
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 18 18:34:51 2012 +0100

also shrink used area for HTML in some cases, fdo#46230, n#677811

Hopefully this will allow pasting to external applications with whole
column/row selected while not affecting calc itself.

(cherry picked from commit 0ee518863337fba9bce019e05e24f527617a4321)

Signed-off-by: Tor Lillqvist tlillqv...@suse.com

diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index a61e5d3..ae73542 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -313,7 +313,20 @@ sal_Bool ScTransferObj::GetData( const 
datatransfer::DataFlavor rFlavor )
 
 sal_Bool bIncludeFiltered = pDoc-IsCutMode() || bUsedForLink;
 
-ScImportExport aObj( pDoc, aBlock );
+ScRange aReducedBlock = aBlock;
+if ( nFormat == SOT_FORMATSTR_ID_HTML  (aBlock.aEnd.Col() == 
MAXCOL || aBlock.aEnd.Row() == MAXROW)  aBlock.aStart.Tab() == 
aBlock.aEnd.Tab() )
+{
+bool bShrunk = false;
+//shrink the area to allow pasting to external applications
+SCCOL aStartCol = aReducedBlock.aStart.Col();
+SCROW aStartRow = aReducedBlock.aStart.Row();
+SCCOL aEndCol = aReducedBlock.aEnd.Col();
+SCROW aEndRow = aReducedBlock.aEnd.Row();
+pDoc-ShrinkToUsedDataArea( bShrunk, 
aReducedBlock.aStart.Tab(), aStartCol, aStartRow, aEndCol, aEndRow, false);
+aReducedBlock = ScRange(aStartCol, aStartRow, 
aReducedBlock.aStart.Tab(), aEndCol, aEndRow, aReducedBlock.aEnd.Tab());
+}
+
+ScImportExport aObj( pDoc, aReducedBlock );
 ScExportTextOptions aTextOptions(ScExportTextOptions::None, 0, 
true);
 if ( bUsedForLink )
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-19 Thread Tor Lillqvist
 sc/source/filter/xml/xmldrani.cxx |   10 +++---
 sc/source/filter/xml/xmldrani.hxx |2 ++
 2 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit a0d2fd2096e267a29c5b8a07b0349e699e13ded5
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 18 17:44:00 2012 +0100

add all imported properties to ScDBData, fdo#40426

(cherry picked from commit ed88b144ce24b9a733d4a9ab6614307c96537baa)

Signed-off-by: Tor Lillqvist tlillqv...@suse.com

diff --git a/sc/source/filter/xml/xmldrani.cxx 
b/sc/source/filter/xml/xmldrani.cxx
index 653af63..a0ca754 100644
--- a/sc/source/filter/xml/xmldrani.cxx
+++ b/sc/source/filter/xml/xmldrani.cxx
@@ -148,6 +148,8 @@ ScXMLDatabaseRangeContext::ScXMLDatabaseRangeContext( 
ScXMLImport rImport,
 bSubTotalsEnabledUserList(false),
 bSubTotalsAscending(true),
 bFilterConditionSourceRange(false),
+bHasHeader(true),
+bByRow(false),
 meRangeType(ScDBCollection::GlobalNamed)
 {
 nSourceType = sheet::DataImportMode_NONE;
@@ -190,12 +192,14 @@ ScXMLDatabaseRangeContext::ScXMLDatabaseRangeContext( 
ScXMLImport rImport,
 break;
 case XML_TOK_DATABASE_RANGE_ATTR_ORIENTATION :
 {
-mpQueryParam-bByRow = !IsXMLToken(sValue, XML_COLUMN);
+bByRow = !IsXMLToken(sValue, XML_COLUMN);
+mpQueryParam-bByRow = bByRow;
 }
 break;
 case XML_TOK_DATABASE_RANGE_ATTR_CONTAINS_HEADER :
 {
-mpQueryParam-bHasHeader = IsXMLToken(sValue, XML_TRUE);
+bHasHeader = IsXMLToken(sValue, XML_TRUE);
+mpQueryParam-bHasHeader = bHasHeader;
 }
 break;
 case XML_TOK_DATABASE_RANGE_ATTR_DISPLAY_FILTER_BUTTONS :
@@ -303,7 +307,7 @@ ScDBData* ScXMLDatabaseRangeContext::ConvertToDBData(const 
OUString rName)
 
 SAL_WNODEPRECATED_DECLARATIONS_PUSH
 ::std::auto_ptrScDBData pData(
-new ScDBData(rName, maRange.aStart.Tab(), maRange.aStart.Col(), 
maRange.aStart.Row(), maRange.aEnd.Col(), maRange.aEnd.Row()));
+new ScDBData(rName, maRange.aStart.Tab(), maRange.aStart.Col(), 
maRange.aStart.Row(), maRange.aEnd.Col(), maRange.aEnd.Row(), bByRow, 
bHasHeader));
 SAL_WNODEPRECATED_DECLARATIONS_POP
 
 pData-SetAutoFilter(bAutoFilter);
diff --git a/sc/source/filter/xml/xmldrani.hxx 
b/sc/source/filter/xml/xmldrani.hxx
index 9fe1408..ff659f8 100644
--- a/sc/source/filter/xml/xmldrani.hxx
+++ b/sc/source/filter/xml/xmldrani.hxx
@@ -106,6 +106,8 @@ class ScXMLDatabaseRangeContext : public SvXMLImportContext
 boolbSubTotalsEnabledUserList;
 boolbSubTotalsAscending;
 boolbFilterConditionSourceRange;
+boolbHasHeader;
+boolbByRow;
 ScDBCollection::RangeType meRangeType;
 
 const ScXMLImport GetScImport() const { return (const 
ScXMLImport)GetImport(); }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-19 Thread Kohei Yoshida
 sc/source/ui/app/transobj.cxx   |3 ---
 sc/source/ui/docshell/impex.cxx |   20 ++--
 2 files changed, 14 insertions(+), 9 deletions(-)

New commits:
commit a58d877fd576bacd738972a78c8310d4eccb0daa
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Mar 13 01:19:48 2012 +0100

only shrink to used area in text export, fdo#46230, related n#677811

Signed-off-by: Kohei Yoshida kohei.yosh...@gmail.com

diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index ae73542..3d70f84 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -172,9 +172,6 @@ ScTransferObj::ScTransferObj( ScDocument* pClipDoc, const 
TransferableObjectDesc
 }
 OSL_ENSURE(!bFirst, no sheet selected);
 
-if (!pDoc-GetClipParam().isMultiRange()  nTab1 == nTab2)
-pDoc-ShrinkToDataArea( nTab1, nCol1, nRow1, nCol2, nRow2 );
-
 //  only limit to used cells if whole sheet was marked
 //  (so empty cell areas can be copied)
 if ( nCol2=MAXCOL  nRow2=MAXROW )
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 5abf7d5..c183387 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -69,6 +69,7 @@ class StarBASIC;
 #include editable.hxx
 #include compiler.hxx
 #include warnbox.hxx
+#include clipparam.hxx
 
 #include impex.hxx
 
@@ -1436,26 +1437,33 @@ sal_Bool ScImportExport::Doc2Text( SvStream rStrm )
 SCROW nRow;
 SCCOL nStartCol = aRange.aStart.Col();
 SCROW nStartRow = aRange.aStart.Row();
+SCTAB nStartTab = aRange.aStart.Tab();
 SCCOL nEndCol = aRange.aEnd.Col();
 SCROW nEndRow = aRange.aEnd.Row();
+SCTAB nEndTab = aRange.aEnd.Tab();
+
+if (!pDoc-GetClipParam().isMultiRange()  nStartTab == nEndTab)
+pDoc-ShrinkToDataArea( nStartTab, nStartCol, nStartRow, nEndCol, 
nEndRow );
+
 String aCell;
+
 bool bConvertLF = (GetSystemLineEnd() != LINEEND_LF);
 
 for (nRow = nStartRow; nRow = nEndRow; nRow++)
 {
-if (bIncludeFiltered || !pDoc-RowFiltered( nRow, aRange.aStart.Tab() 
))
+if (bIncludeFiltered || !pDoc-RowFiltered( nRow, nStartTab ))
 {
 for (nCol = nStartCol; nCol = nEndCol; nCol++)
 {
 CellType eType;
-pDoc-GetCellType( nCol, nRow, aRange.aStart.Tab(), eType );
+pDoc-GetCellType( nCol, nRow, nStartTab, eType );
 switch (eType)
 {
 case CELLTYPE_FORMULA:
 {
 if (bFormulas)
 {
-pDoc-GetFormula( nCol, nRow, aRange.aStart.Tab(), 
aCell );
+pDoc-GetFormula( nCol, nRow, nStartTab, aCell );
 if( aCell.Search( cSep ) != STRING_NOTFOUND )
 lcl_WriteString( rStrm, aCell, cStr, cStr );
 else
@@ -1463,7 +1471,7 @@ sal_Bool ScImportExport::Doc2Text( SvStream rStrm )
 }
 else
 {
-pDoc-GetString( nCol, nRow, aRange.aStart.Tab(), 
aCell );
+pDoc-GetString( nCol, nRow, nStartTab, aCell );
 
 bool bMultiLineText = ( aCell.Search( _LF ) != 
STRING_NOTFOUND );
 if( bMultiLineText )
@@ -1486,7 +1494,7 @@ sal_Bool ScImportExport::Doc2Text( SvStream rStrm )
 break;
 case CELLTYPE_VALUE:
 {
-pDoc-GetString( nCol, nRow, aRange.aStart.Tab(), 
aCell );
+pDoc-GetString( nCol, nRow, nStartTab, aCell );
 lcl_WriteSimpleString( rStrm, aCell );
 }
 break;
@@ -1495,7 +1503,7 @@ sal_Bool ScImportExport::Doc2Text( SvStream rStrm )
 break;
 default:
 {
-pDoc-GetString( nCol, nRow, aRange.aStart.Tab(), 
aCell );
+pDoc-GetString( nCol, nRow, nStartTab, aCell );
 
 bool bMultiLineText = ( aCell.Search( _LF ) != 
STRING_NOTFOUND );
 if( bMultiLineText )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-17 Thread Andras Timar
 sc/source/ui/view/prevwsh.cxx  |7 ++-
 sc/source/ui/view/printfun.cxx |7 ++-
 sc/source/ui/view/tabvwsh4.cxx |8 +++-
 3 files changed, 19 insertions(+), 3 deletions(-)

New commits:
commit 1f26de8f2438170db504f67b82544965b9869c5e
Author: Szabolcs Dezsi dezsisz...@hotmail.com
Date:   Thu Mar 15 15:23:17 2012 +0100

i#84393 Fix title field in header, footer

According to help Title should be the Title property of the document,
not the file name without extension. If that property is missing, we
fall back to file name without extension.

Signed-off-by: Andras Timar ati...@suse.com

diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index ef995ba..12ae9d1 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -75,6 +75,7 @@
 #include svx/dialogs.hrc
 
 #include svx/zoom_def.hxx
+#include com/sun/star/document/XDocumentProperties.hpp
 
 #include sc.hrc
 #include scabstdlg.hxx
@@ -840,7 +841,11 @@ void ScPreviewShell::FillFieldData( ScHeaderFieldData 
rData )
 pDoc-GetName(nTab, aTmp);
 rData.aTabName = aTmp;
 
-rData.aTitle= pDocShell-GetTitle();
+if( pDocShell-getDocProperties()-getTitle().getLength() != 0 )
+rData.aTitle = pDocShell-getDocProperties()-getTitle();
+else
+rData.aTitle = pDocShell-GetTitle();
+
 const INetURLObject rURLObj = pDocShell-GetMedium()-GetURLObject();
 rData.aLongDocName  = rURLObj.GetMainURL( 
INetURLObject::DECODE_UNAMBIGUOUS );
 if ( rData.aLongDocName.Len() )
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index e6484ce..73583b4 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -83,6 +83,7 @@
 #include vcl/lineinfo.hxx
 
 #include boost/scoped_ptr.hpp
+#include com/sun/star/document/XDocumentProperties.hpp
 
 #define ZOOM_MIN10
 
@@ -1037,7 +1038,11 @@ void ScPrintFunc::InitParam( const ScPrintOptions* 
pOptions )
 
 SetDateTime( Date( Date::SYSTEM ), Time( Time::SYSTEM ) );
 
-aFieldData.aTitle   = pDocShell-GetTitle();
+if( pDocShell-getDocProperties()-getTitle().getLength() != 0 )
+aFieldData.aTitle = pDocShell-getDocProperties()-getTitle();
+else
+aFieldData.aTitle = pDocShell-GetTitle();
+
 const INetURLObject rURLObj = pDocShell-GetMedium()-GetURLObject();
 aFieldData.aLongDocName = rURLObj.GetMainURL( 
INetURLObject::DECODE_UNAMBIGUOUS );
 if ( aFieldData.aLongDocName.Len() )
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index f8e2ab8..ffb64a3 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -97,6 +97,8 @@
 #include markdata.hxx
 #include preview.hxx
 
+#include com/sun/star/document/XDocumentProperties.hpp
+
 void ActivateOlk( ScViewData* pViewData );
 void DeActivateOlk( ScViewData* pViewData );
 
@@ -1824,7 +1826,11 @@ void ScTabViewShell::FillFieldData( ScHeaderFieldData 
rData )
 pDoc-GetName(nTab, aTmp);
 rData.aTabName = aTmp;
 
-rData.aTitle= pDocShell-GetTitle();
+if( pDocShell-getDocProperties()-getTitle().getLength() != 0 )
+rData.aTitle = pDocShell-getDocProperties()-getTitle();
+else
+rData.aTitle = pDocShell-GetTitle();
+
 const INetURLObject rURLObj = pDocShell-GetMedium()-GetURLObject();
 rData.aLongDocName  = rURLObj.GetMainURL( 
INetURLObject::DECODE_UNAMBIGUOUS );
 if ( rData.aLongDocName.Len() )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-16 Thread Kohei Yoshida
 sc/source/core/data/cell.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 14ed2c61066b38d812bb68c4c1f02f8cb7c97f4d
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Mar 15 22:22:10 2012 +0100

update the relatice refs after the absolute refs, fdo#47285

The algoithm for updating absolute refs needs to calculate the old
position based on the information before any updates to the RefData

Signed-off-by: Kohei Yoshida kohei.yosh...@gmail.com

diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 9b431fa..4ed94b9 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -861,9 +861,6 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell rCell, 
ScDocument rDoc, cons
 {
 pCode = rCell.pCode-Clone();
 
-if ( nCloneFlags  SC_CLONECELL_ADJUST3DREL )
-pCode-ReadjustRelative3DReferences( rCell.aPos, aPos );
-
 // evtl. Fehler zuruecksetzen und neu kompilieren
 //  nicht im Clipboard - da muss das Fehlerflag erhalten bleiben
 //  Spezialfall Laenge=0: als Fehlerzelle erzeugt, dann auch Fehler 
behalten
@@ -900,6 +897,9 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell rCell, 
ScDocument rDoc, cons
 pCode-AdjustAbsoluteRefs( rCell.pDocument, rCell.aPos, aPos );
 }
 
+if ( nCloneFlags  SC_CLONECELL_ADJUST3DREL )
+pCode-ReadjustRelative3DReferences( rCell.aPos, aPos );
+
 if( !bCompile )
 {   // Name references with references and ColRowNames
 pCode-Reset();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-16 Thread Kohei Yoshida
 sc/source/ui/view/viewfun5.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 76f3a63432e70d017760a2087652a1abc9b126d3
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 16 10:45:01 2012 +0100

don't paste content if user cancels html import, fdo#47393

Signed-off-by: Kohei Yoshida kohei.yosh...@gmail.com

diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index eae1329..cdf373a 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -322,9 +322,15 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
 
aOptions.SetDetectSpecialNumber(pDlg-IsDateConversionSet());
 aObj.SetExtOptions(aOptions);
 }
+else
+{
+// prevent error dialog for user cancel action
+bRet = true;
+}
 }
+if(!bRet)
+bRet = aObj.ImportStream( *xStream, String(), nFormatId );
 // mba: clipboard always must contain absolute URLs (could be 
from alien source)
-bRet = aObj.ImportStream( *xStream, String(), nFormatId );
 }
 else if (nFormatId == FORMAT_STRING  aDataHelper.GetString( 
nFormatId, aStr ))
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-16 Thread Kohei Yoshida
 sc/source/ui/app/inputhdl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c39e96d984b5907f8e0c0247828c8e35f2e9ce72
Author: Noel Power noel.po...@novell.com
Date:   Thu Mar 15 20:10:12 2012 +

fix to update inputbar when setting a range for a formula fdo#46809

Signed-off-by: Kohei Yoshida kohei.yosh...@gmail.com

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 95d2b7f..e461b0b 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1719,7 +1719,7 @@ void ScInputHandler::UpdateActiveView()
 else
 pTableView = NULL;
 
-if (pInputWin  pInputWin-IsInputActive())
+if (pInputWin  eMode == SC_INPUT_TOP )
 pTopView = pInputWin-GetEditView();
 else
 pTopView = NULL;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-12 Thread Kohei Yoshida
 sc/source/ui/unoobj/chart2uno.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 36e877cf80eb3b7fc092c08cdc166b75d674bf53
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sat Mar 10 16:23:34 2012 +0100

take explicit number format before implicit number format, fdo#47084

Follow-up to fdo#43467

Signed-off-by: Kohei Yoshida kohei.yosh...@gmail.com

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 93dcb56..effb9e8 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -3285,7 +3285,7 @@ sal_uLong getDisplayNumberFormat(ScDocument* pDoc, const 
ScAddress rPos)
 return nFormat;
 
 ScBaseCell* pCell = pDoc-GetCell(rPos);
-if (!pCell || pCell-GetCellType() != CELLTYPE_FORMULA)
+if (!pCell || pCell-GetCellType() != CELLTYPE_FORMULA || nFormat)
 return nFormat;
 
 // With formula cell, the format may be inferred from the formula result.
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-09 Thread Kohei Yoshida
 sc/source/ui/attrdlg/condfrmt.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit ff3322a98f7817bd383a2d88fa5ba057648dfeaf
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 9 01:17:13 2012 +0100

Set entries correctly visible, fdo#47102

Signed-off-by: Kohei Yoshida kohei.yosh...@gmail.com

diff --git a/sc/source/ui/attrdlg/condfrmt.cxx 
b/sc/source/ui/attrdlg/condfrmt.cxx
index 4687bb8..c0fdf6b 100644
--- a/sc/source/ui/attrdlg/condfrmt.cxx
+++ b/sc/source/ui/attrdlg/condfrmt.cxx
@@ -647,6 +647,8 @@ IMPL_LINK( ScConditionalFormatDlg, ChangeCond11Hdl, void *, 
EMPTYARG )
 aRbCond12.Hide();
 aRbCond11.SetPosPixel( aRBtn1Pos2 );
 aEdtCond11.SetPosSizePixel( aCond1Pos1, aCond1Size1 );
+aEdtCond11.Show();
+aRbCond11.Show();
 }
 
 ChangeCond12Hdl( NULL );
@@ -742,6 +744,8 @@ IMPL_LINK( ScConditionalFormatDlg, ChangeCond21Hdl, void *, 
EMPTYARG )
 aRbCond22.Hide();
 aRbCond21.SetPosPixel( aRBtn2Pos2 );
 aEdtCond21.SetPosSizePixel( aCond2Pos1, aCond2Size1 );
+aEdtCond21.Show();
+aRbCond21.Show();
 }
 
 ChangeCond22Hdl( NULL );
@@ -839,6 +843,8 @@ IMPL_LINK( ScConditionalFormatDlg, ChangeCond31Hdl, void *, 
EMPTYARG )
 aRbCond32.Hide();
 aRbCond31.SetPosPixel( aRBtn3Pos2 );
 aEdtCond31.SetPosSizePixel( aCond3Pos1, aCond3Size1 );
+aEdtCond31.Show();
+aRbCond31.Show();
 }
 
 ChangeCond32Hdl( NULL );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-07 Thread Kohei Yoshida
 sc/source/filter/xml/xmlexprt.cxx |   17 +++--
 1 file changed, 3 insertions(+), 14 deletions(-)

New commits:
commit 766931e1de1adee987108d59d96431dc41cd2d96
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Mar 7 15:09:16 2012 +0100

export all row styles, fdo#46336

only exporting the used row styles is a loss of information since this
means that all following rows use the height of the default row style
 # Changes to be committed:

Signed-off-by: Kohei Yoshida kohei.yosh...@suse.com

diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index 3ad8b8b..2c3e1c1 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2449,16 +2449,10 @@ void ScXMLExport::_ExportAutoStyles()
 {
 sal_Int32 
nRows(pDoc-GetLastChangedRow(sal::static_int_castSCTAB(nTable)));
 pSharedData-SetLastRow(nTable, nRows);
-table::CellRangeAddress 
aCellAddress(GetEndAddress(xTable, nTable));
-if (aCellAddress.EndRow  nRows)
-{
-++nRows;
-pRowStyles-AddNewTable(nTable, 
aCellAddress.EndRow);
-}
-else
-pRowStyles-AddNewTable(nTable, nRows);
+
+pRowStyles-AddNewTable(nTable, MAXROW);
 sal_Int32 nRow = 0;
-while (nRow = nRows  nRow = MAXROW)
+while (nRow = MAXROW)
 {
 sal_Int32 nIndex = 0;
 Reference beans::XPropertySet 
xRowProperties(xTableRows-getByIndex(nRow), uno::UNO_QUERY);
@@ -2472,11 +2466,6 @@ void ScXMLExport::_ExportAutoStyles()
 if (nRow  nOld + 1)
 pRowStyles-AddFieldStyleName(nTable, nOld + 
1, nIndex, nRow - 1);
 }
-if (aCellAddress.EndRow  nRows)
-{
-sal_Int32 
nIndex(pRowStyles-GetStyleNameIndex(nTable, nRows));
-pRowStyles-AddFieldStyleName(nTable, nRows + 1, 
nIndex, aCellAddress.EndRow);
-}
 }
 }
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-06 Thread Noel Power
 sc/source/ui/app/inputwin.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 0dfd481888abcb14b601ca039692e9d83c1be19a
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Mar 6 01:16:43 2012 +0100

don't crash when scrolling in input line, fdo#46975

Signed-off-by: Noel Power noel.po...@novell.com

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 3e53062..b7592e3 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1609,6 +1609,10 @@ void ScTextWnd::Command( const CommandEvent rCEvt )
 rBindings.Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
 }
 }
+else if ( nCommand == COMMAND_WHEEL )
+{
+//don't call InputChanged for COMMAND_WHEEL
+}
 else
 SC_MOD()-InputChanged( pEditView );
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-05 Thread Michael Meeks
 sc/source/ui/unoobj/chart2uno.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6444d7ed7a4f99ffcd8d04c5d27722d8c4d942b2
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 4 00:05:33 2012 +0100

don't crash for empty input data in charts, fdo#46885

Signed-off-by: Michael Meeks michael.me...@suse.com

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 53b049b..93dcb56 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1565,7 +1565,7 @@ ScChart2DataProvider::createDataSource(
 }
 Reference chart2::data::XLabeledDataSequence  xChartSeries = 
lcl_createLabeledDataSequenceFromTokens(
 pValueTokens, pLabelTokens, m_pDocument, this, 
m_bIncludeHiddenCells ); //ownership of pointers is transfered!
-if ( xChartSeries.is()  
xChartSeries-getValues()-getData().getLength() )
+if ( xChartSeries.is()  xChartSeries-getValues().is()  
xChartSeries-getValues()-getData().getLength() )
 {
 aSeqs.push_back( xChartSeries );
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-02 Thread Kohei Yoshida
 sc/source/ui/namedlg/namedefdlg.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit f4f0ef5790bd06145d977183da0ee244c5c46058
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 2 23:48:44 2012 +0100

don't show an error message for empty names in Define Names, fdo#46816

Signed-off-by: Kohei Yoshida kohei.yosh...@suse.com

diff --git a/sc/source/ui/namedlg/namedefdlg.cxx 
b/sc/source/ui/namedlg/namedefdlg.cxx
index 45c600b..d060566 100644
--- a/sc/source/ui/namedlg/namedefdlg.cxx
+++ b/sc/source/ui/namedlg/namedefdlg.cxx
@@ -166,7 +166,13 @@ bool ScNameDefDlg::IsNameValid()
 }
 
 
maFtInfo.SetControlBackground(GetSettings().GetStyleSettings().GetDialogColor());
-if (!ScRangeData::IsNameValid( aName, mpDoc ))
+if ( aName.isEmpty() )
+{
+maBtnAdd.Disable();
+maFtInfo.SetText(maStrInfoDefault);
+return false;
+}
+else if (!ScRangeData::IsNameValid( aName, mpDoc ))
 {
 
maFtInfo.SetControlBackground(GetSettings().GetStyleSettings().GetHighlightColor());
 maFtInfo.SetText(maErrInvalidNameStr);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-01 Thread Kohei Yoshida
 sc/source/core/data/documen2.cxx |   79 ---
 1 file changed, 79 deletions(-)

New commits:
commit fcc9e377ad525a919ab13e7b0424a6c6d5673878
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Mar 1 12:36:10 2012 +0100

don't try to update the range names twice

the update process is now done in cell.cxx:adjustRangeNames

Signed-off-by: Kohei Yoshida kohei.yosh...@suse.com

diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index b0ae78e..567135d 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -994,80 +994,6 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, 
SCTAB nSrcPos,
 
 if ( !bResultsOnly )
 {
-bool bNamesLost = false;
-// array containing range names which might need update of indices.
-// The instances inserted into this vector are managed by the
-// range name container of this document, so no need to delete
-// them afterward.
-::std::vectorScRangeData* aSrcRangeNames;
-
-// the index mapping thereof
-ScRangeData::IndexMap aSrcRangeMap;
-bool bRangeNameReplace = false;
-
-// find named ranges that are used in the source sheet
-std::setsal_uInt16 aUsedNames;
-pSrcDoc-maTabs[nSrcPos]-FindRangeNamesInUse( 0, 0, MAXCOL, 
MAXROW, aUsedNames );
-
-if (pSrcDoc-pRangeName)
-{
-ScRangeName::const_iterator itr = 
pSrcDoc-pRangeName-begin(), itrEnd = pSrcDoc-pRangeName-end();
-for (; itr != itrEnd; ++itr)//! DB-Bereiche 
Pivot-Bereiche auch !!!
-{
-sal_uInt16 nOldIndex = itr-second-GetIndex();
-bool bInUse = ( aUsedNames.find(nOldIndex) != 
aUsedNames.end() );
-if (bInUse)
-{
-const ScRangeData* pExistingData = 
GetRangeName()-findByUpperName(itr-second-GetUpperName());
-if (pExistingData)
-{
-// the name exists already in the destination 
document
-// - use the existing name, but show a warning
-// (when refreshing links, the existing name is 
used and the warning not shown)
-
-sal_uInt16 nExistingIndex = 
pExistingData-GetIndex();
-
-// don't modify the named range
-aSrcRangeMap.insert(
-ScRangeData::IndexMap::value_type(nOldIndex, 
nExistingIndex));
-bRangeNameReplace = true;
-bNamesLost = true;
-}
-else
-{
-ScRangeData* pData = new ScRangeData( *itr-second 
);
-pData-SetDocument(this);
-if ( pRangeName-findByIndex( pData-GetIndex() ) )
-pData-SetIndex(0); // need new index, 
done in Insert
-if (!pRangeName-insert(pData))
-{
-OSL_FAIL(can't insert name); // 
shouldn't happen
-pData = NULL;
-}
-else
-{
-pData-TransferTabRef( nSrcPos, nDestPos );
-aSrcRangeNames.push_back(pData);
-sal_uInt16 nNewIndex = pData-GetIndex();
-aSrcRangeMap.insert(
-
ScRangeData::IndexMap::value_type(nOldIndex, nNewIndex));
-if ( !bRangeNameReplace )
-bRangeNameReplace = ( nOldIndex != 
nNewIndex );
-}
-}
-}
-}
-}
-if ( bRangeNameReplace )
-{
-// first update all inserted named formulas if they contain 
other
-// range names and used indices changed
-for (size_t i = 0, n = aSrcRangeNames.size(); i  n; ++i)  
 //! DB-Bereiche Pivot-Bereiche auch
-aSrcRangeNames[i]-ReplaceRangeNamesInUse( aSrcRangeMap );
-
-// then update the formulas, they might need the just updated 
range names
-maTabs[nDestPos]-ReplaceRangeNamesInUse( 0, 0, MAXCOL, 
MAXROW, aSrcRangeMap );
-}
 
 SCsTAB nDz = ((SCsTAB)nDestPos) - (SCsTAB)nSrcPos;
 maTabs[nDestPos]-UpdateReference(URM_COPY, 0, 0, nDestPos,
@@ -1075,11 +1001,6 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, 
SCTAB nSrcPos,
  

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-01 Thread Kohei Yoshida
 sc/source/core/data/documen2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 55b3c7430637d2b0005d7c0332e7221c69138a63
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Mar 1 11:50:13 2012 +0100

use correct source table

Signed-off-by: Kohei Yoshida kohei.yosh...@suse.com

diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 567135d..cf3e81c 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -955,7 +955,7 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, 
SCTAB nSrcPos,
 
 // Copy the RTL settings
 
maTabs[nDestPos]-SetLayoutRTL(pSrcDoc-maTabs[nSrcPos]-IsLayoutRTL());
-
maTabs[nDestPos]-SetLoadingRTL(pSrcDoc-maTabs[nDestPos]-IsLoadingRTL());
+
maTabs[nDestPos]-SetLoadingRTL(pSrcDoc-maTabs[nSrcPos]-IsLoadingRTL());
 }
 else// bestehende Tabelle ersetzen
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-03-01 Thread Kohei Yoshida
 sc/source/core/data/cell.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 94d4301ac51589f0f5ae39039c0f1f7379677b3a
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Mar 1 12:59:14 2012 +0100

use the correct db range for the copy, fdo#46712

Signed-off-by: Kohei Yoshida kohei.yosh...@suse.com

diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 8ddc540..9b431fa 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -226,7 +226,7 @@ void adjustDBRange(ScToken* pToken, ScDocument rNewDoc, 
const ScDocument* pOldD
 ScDBData* pNewDBData = aNewNamedDBs.findByName(aDBName);
 if (!pNewDBData)
 {
-pNewDBData = new ScDBData(*pNewDBData);
+pNewDBData = new ScDBData(*pDBData);
 aNewNamedDBs.insert(pNewDBData);
 }
 pToken-SetIndex(pNewDBData-GetIndex());
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-02-26 Thread Markus Mohrhard
 sc/source/ui/namedlg/namedlg.cxx |   18 ++
 1 file changed, 18 insertions(+)

New commits:
commit 393bd0eebe09230ef90c5b343c93338526f3f4b7
Author: Noel Power noel.po...@novell.com
Date:   Fri Feb 24 12:27:37 2012 +

fix core when clicking on entries in Manage Names dialog in calc fdo#46568

diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index 56c50e8..06ad128 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -269,10 +269,28 @@ void ScNameDlg::SetActive()
 
 void ScNameDlg::UpdateChecks(ScRangeData* pData)
 {
+// remove handlers, we only want the handlers to process
+// user input and not when we are syncing the controls  with our internal
+// model ( also UpdateChecks is called already from some other event
+// handlers, triggering handlers while already processing a handler can
+// ( and does in this case ) corrupt the internal data
+
+maBtnCriteria.SetToggleHdl( Link() );
+maBtnPrintArea.SetToggleHdl( Link() );
+maBtnColHeader.SetToggleHdl( Link() );
+maBtnRowHeader.SetToggleHdl( Link() );
+
 maBtnCriteria .Check( pData-HasType( RT_CRITERIA ) );
 maBtnPrintArea.Check( pData-HasType( RT_PRINTAREA ) );
 maBtnColHeader.Check( pData-HasType( RT_COLHEADER ) );
 maBtnRowHeader.Check( pData-HasType( RT_ROWHEADER ) );
+
+// Restore handlers so user input is processed again
+Link aToggleHandler = LINK( this, ScNameDlg, EdModifyHdl );
+maBtnCriteria.SetToggleHdl( aToggleHandler );
+maBtnPrintArea.SetToggleHdl( aToggleHandler );
+maBtnColHeader.SetToggleHdl( aToggleHandler );
+maBtnRowHeader.SetToggleHdl( aToggleHandler );
 }
 
 bool ScNameDlg::IsNameValid()
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-02-13 Thread Ivan Timofeev
 sc/source/core/data/cell.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 202019a7671ff9f4f1431513cd606a6bf1bcddef
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Mon Feb 13 12:26:50 2012 -0500

fdo#45916: Ensure formula cell's pCode isn't NULL even when compilation 
fails.

Signed-off-by: Ivan Timofeev timofeev@gmail.com

diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 155f4bd..8ddc540 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -782,6 +782,9 @@ ScFormulaCell::ScFormulaCell( ScDocument* pDoc, const 
ScAddress rPos,
 aPos( rPos )
 {
 Compile( rFormula, true, eGrammar );// bNoListening, Insert does that
+if (!pCode)
+// We need to have a non-NULL token array instance at all times.
+pCode = new ScTokenArray;
 }
 
 // Wird von den Importfiltern verwendet
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-02-08 Thread Kohei Yoshida
 sc/source/ui/docshell/impex.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a00c5917a8deb465cc1322e14a81340f9d69
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Feb 8 23:37:49 2012 +0100

we need to explicitly set the paste area in ScMarkData, fdo#45481

Signed-off-by: Kohei Yoshida kohei.yosh...@suse.com

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index c538977..5abf7d5 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -263,7 +263,7 @@ void ScImportExport::EndPaste()
 pRedoDoc-InitUndo( pDoc, aRange.aStart.Tab(), aRange.aEnd.Tab() );
 pDoc-CopyToDocument( aRange, IDF_ALL | IDF_NOCAPTIONS, false, 
pRedoDoc );
 ScMarkData aDestMark;
-aDestMark.SelectOneTable( aRange.aStart.Tab() );
+aDestMark.SetMarkArea(aRange);
 pDocSh-GetUndoManager()-AddUndoAction(
 new ScUndoPaste(pDocSh, aRange, aDestMark, pUndoDoc, pRedoDoc, 
IDF_ALL, NULL));
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-02-08 Thread Kohei Yoshida
 sc/source/core/data/documen2.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 3544c86341bd32864cac7f30124a53aef79b89fd
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Feb 8 17:48:15 2012 +0100

copy settings for RTL with sheets, fdo#45768

Signed-off-by: Kohei Yoshida kohei.yosh...@suse.com

diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 40a10ba..b0ae78e 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -913,6 +913,10 @@ bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, 
const ScMarkData* pOnlyM
 
 // Copy the custom print range if exists.
 maTabs[nNewPos]-CopyPrintRange(*maTabs[nOldPos]);
+
+// Copy the RTL settings
+maTabs[nNewPos]-SetLayoutRTL(maTabs[nOldPos]-IsLayoutRTL());
+maTabs[nNewPos]-SetLoadingRTL(maTabs[nOldPos]-IsLoadingRTL());
 }
 else
 SetAutoCalc( bOldAutoCalc );
@@ -948,6 +952,10 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, 
SCTAB nSrcPos,
 pSrcDoc-GetName(nSrcPos, aName);
 CreateValidTabName(aName);
 bValid = InsertTab(nDestPos, aName);
+
+// Copy the RTL settings
+
maTabs[nDestPos]-SetLayoutRTL(pSrcDoc-maTabs[nSrcPos]-IsLayoutRTL());
+
maTabs[nDestPos]-SetLoadingRTL(pSrcDoc-maTabs[nDestPos]-IsLoadingRTL());
 }
 else// bestehende Tabelle ersetzen
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-27 Thread Eike Rathke
 sc/source/core/data/column3.cxx |   29 ++---
 1 file changed, 22 insertions(+), 7 deletions(-)

New commits:
commit 08adeedce926bac1a010c26f2a4ae2d5fb761376
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Thu Jan 26 15:47:52 2012 -0500

fdo#44143: Keep cells with broadcasters alive during deletion.

Or else it would partially break formula reference chain.
(cherry picked from commit 41e92ab2b7a8fcb7f5738f656bdac47bc0847f29)

Signed-off-by: Eike Rathke er...@redhat.com

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index fbeb951..5d96af1 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -35,6 +35,7 @@
 #include sfx2/objsh.hxx
 #include svl/zforlist.hxx
 #include svl/zformat.hxx
+#include svl/broadcast.hxx
 
 #include scitems.hxx
 #include column.hxx
@@ -465,14 +466,25 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE 
nEndIndex, sal_uInt16 nDe
 if (bDelete)
 {
 // try to create a replacement note cell, if note or 
broadcaster exists
-ScNoteCell* pNoteCell = 0;
-if (eCellType != CELLTYPE_NOTE)
+ScNoteCell* pNoteCell = NULL;
+SvtBroadcaster* pBC = pOldCell-GetBroadcaster();
+bool bKeepBC = pBC  pBC-HasListeners();
+if (eCellType == CELLTYPE_NOTE)
+{
+if (bKeepBC)
+{
+// We need to keep this note cell to keep the 
broadcaster.
+pNoteCell = static_castScNoteCell*(pOldCell);
+if (bDeleteNote)
+pOldCell-DeleteNote();
+}
+}
+else
 {
 // do not rescue note if it has to be deleted according to 
passed flags
 ScPostIt* pNote = bDeleteNote ? 0 : 
pOldCell-ReleaseNote();
 // #i99844# do not release broadcaster from old cell, it 
still has to notify deleted content
-SvtBroadcaster* pBC = pOldCell-GetBroadcaster();
-if( pNote || pBC )
+if (pNote || bKeepBC)
 pNoteCell = new ScNoteCell( pNote, pBC );
 }
 
@@ -498,9 +510,12 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE 
nEndIndex, sal_uInt16 nDe
 aHint.GetAddress().SetRow( nOldRow );
 aHint.SetCell( pOldCell );
 pDocument-Broadcast( aHint );
-// #i99844# after broadcasting, old cell has to forget the 
broadcaster (owned by pNoteCell)
-pOldCell-ReleaseBroadcaster();
-pOldCell-Delete();
+if (pNoteCell != pOldCell)
+{
+// #i99844# after broadcasting, old cell has to forget 
the broadcaster (owned by pNoteCell)
+pOldCell-ReleaseBroadcaster();
+pOldCell-Delete();
+}
 }
 }
 else
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-25 Thread Petr Mladek
 sc/source/core/data/dpoutput.cxx |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 6cc0bf1394ef9d6941d38a55a6155688a6f9bd43
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Tue Jan 24 16:32:10 2012 -0500

fdo#45067: Differentiate numeric and non-numeric field member values.

Signed-off-by: Petr Mladek pmla...@suse.cz

diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index 990e212..32179e3 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -795,10 +795,18 @@ void ScDPOutput::HeaderCell( SCCOL nCol, SCROW nRow, 
SCTAB nTab,
 
 if ( nFlags  sheet::MemberResultFlags::HASMEMBER )
 {
-// Avoid unwanted automatic format detection.
+bool bNumeric = (nFlags  sheet::MemberResultFlags::NUMERIC) != 0;
 ScSetStringParam aParam;
-aParam.mbDetectNumberFormat = false;
-aParam.mbSetTextCellFormat = true;
+if (bNumeric)
+{
+aParam.mbDetectNumberFormat = true;
+aParam.mbSetTextCellFormat = false;
+}
+else
+{
+aParam.mbDetectNumberFormat = false;
+aParam.mbSetTextCellFormat = true;
+}
 pDoc-SetString(nCol, nRow, nTab, rData.Caption, aParam);
 }
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-24 Thread Markus Mohrhard
 sc/source/ui/app/inputwin.cxx |   15 +++
 sc/source/ui/inc/inputwin.hxx |1 +
 2 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 4fa27dfc0e67adb298bbb412657958908433d547
Author: Noel Power noel.po...@novell.com
Date:   Tue Jan 24 11:14:38 2012 +

fix ( hopefully ) viewing artifacts in input line fdo#44391

Signed-off-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 1793fae..37caced 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1125,7 +1125,8 @@ ScMultiTextWnd::ScMultiTextWnd( ScInputBarGroup* pParen, 
ScTabViewShell* pViewSh
 ScTextWnd( pParen, pViewSh ),
 mrGroupBar(* pParen ),
 mnLines( 1 ),
-mnLastExpandedLines( INPUTWIN_MULTILINES )
+mnLastExpandedLines( INPUTWIN_MULTILINES ),
+mbInvalidate( false )
 {
 nTextStartPos = TEXT_MULTI_STARTPOS;
 }
@@ -1138,7 +1139,14 @@ void ScMultiTextWnd::Paint( const Rectangle rRec )
 {
 EditView* pView = GetEditView();
 if ( pView )
-pView-Paint( rRec );
+{
+if ( mbInvalidate )
+{
+pView-Invalidate();
+mbInvalidate = false;
+}
+pEditView-Paint( rRec );
+}
 }
 
 EditView* ScMultiTextWnd::GetEditView()
@@ -1403,8 +1411,7 @@ void ScMultiTextWnd::SetTextString( const String 
rNewString )
 // inputbar window scrolled to the bottom if we do that here ( because the 
tableview and topview
 // are synced I guess ).
 // should fix that I suppose :-/ need to look a bit further into that
-if ( pEditView )
-pEditView-Invalidate();
+mbInvalidate = true; // ensure next Paint ( that uses editengine ) call 
will call Invalidate first
 ScTextWnd::SetTextString( rNewString );
 SetScrollBarRange();
 DoScroll();
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index 7b5bc28..eec7fed 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -204,6 +204,7 @@ private:
 ScInputBarGroup mrGroupBar;
 long mnLines;
 long mnLastExpandedLines;
+bool mbInvalidate;
 };
 
 class ScInputBarGroup : public ScTextWndBase
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-23 Thread Kohei Yoshida
 sc/source/filter/html/htmlexp.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 531b11d98d5fedd575d5e1564a937ac109d6bdf5
Author: Eike Rathke er...@redhat.com
Date:   Sun Jan 22 20:13:36 2012 +0100

resolved fdo#45032 Calc export to HTML with graphics failed

Fixed a misconception in transition from List to to ptr_vector of commit
db599f64e63a3141159b7f0e59783197c39b3e02, List::Next() returned NULL when at
end of list, mimic that.

Signed-off-by: Kohei Yoshida kohei.yosh...@suse.com

diff --git a/sc/source/filter/html/htmlexp.cxx 
b/sc/source/filter/html/htmlexp.cxx
index 1f36f9d..0e8fee9 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -883,11 +883,14 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, 
SCTAB nTab )
 size_t ListSize = aGraphList.size();
 for ( size_t i = 0; i  ListSize; ++i )
 {
-pGraphEntry = aGraphList[ i ];
-if ( pGraphEntry-bInCell  pGraphEntry-aRange.In( aPos ) )
+ScHTMLGraphEntry* pE = aGraphList[ i ];
+if ( pE-bInCell  pE-aRange.In( aPos ) )
 {
-if ( pGraphEntry-aRange.aStart == aPos )
+if ( pE-aRange.aStart == aPos )
+{
+pGraphEntry = pE;
 break;  // for
+}
 else
 return ;// ist ein Col/RowSpan, Overlapped
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-23 Thread Kohei Yoshida
 sc/source/core/tool/interpr4.cxx |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 2ec3bc43e1d00ae1911397883976c3724f0bfe14
Author: Eike Rathke er...@redhat.com
Date:   Mon Jan 23 15:43:50 2012 +0100

resolved rhbz#783556 crash in ScMatrix::GetDimensons() from ScInterpreter

* Interpreter tried to access a nonexistent matrix for external reference.
* In ScInterpreter::PopExternalDoubleRef(ScMatrixRef rMat) set error for
  unexpected conditions. In caller or descendants check for error or 
presence
  of ScMatrix.

Signed-off-by: Kohei Yoshida kohei.yosh...@suse.com

diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index c399205..5a36165 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -1286,6 +1286,8 @@ ScDBRangeBase* ScInterpreter::PopDBDoubleRef()
 pMat = PopMatrix();
 else
 PopExternalDoubleRef(pMat);
+if (nGlobalError)
+break;
 return new ScDBExternalRange(pDok, pMat);
 }
 default:
@@ -1542,7 +1544,14 @@ void ScInterpreter::PopExternalDoubleRef(ScMatrixRef 
rMat)
 // references, which means the array should only contain a
 // single matrix token.
 ScToken* p = static_castScToken*(pArray-First());
-rMat = p-GetMatrix();
+if (!p || p-GetType() != svMatrix)
+SetError( errIllegalParameter);
+else
+{
+rMat = p-GetMatrix();
+if (!rMat)
+SetError( errUnknownVariable);
+}
 }
 
 void ScInterpreter::GetExternalDoubleRef(
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-20 Thread Kohei Yoshida
 sc/source/ui/view/gridwin4.cxx |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 43507c9eb49fdc1de2e193eee32326fb226ff170
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Fri Jan 20 21:33:33 2012 -0500

Grid lines should be immediately above or below the background.

Especially grid lines should never be above cell borders.

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index a760257..c7b258f 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -695,9 +695,15 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, 
SCROW nY2, ScUpdateMod
 
 pContentDev-SetMapMode(MAP_PIXEL);
 aOutputData.DrawDocumentBackground();
+
 if ( bGridFirst  ( bGrid || bPage ) )
 aOutputData.DrawGrid( bGrid, bPage );
+
 aOutputData.DrawBackground();
+
+if ( !bGridFirst  ( bGrid || bPage ) )
+aOutputData.DrawGrid( bGrid, bPage );
+
 if ( bPageMode )
 {
 // DrawPagePreview draws complete lines/page numbers, must always be 
clipped
@@ -707,6 +713,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, 
SCROW nY2, ScUpdateMod
 pContentDev-SetClipRegion();
 }
 }
+
 aOutputData.DrawShadow();
 aOutputData.DrawFrame();
 if ( !bLogicText )
@@ -730,10 +737,6 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, 
SCROW nY2, ScUpdateMod
 if ( rOpts.GetOption( VOPT_NOTES ) )
 aOutputData.DrawNoteMarks();
 
-if ( !bGridFirst  ( bGrid || bPage ) )
-{
-aOutputData.DrawGrid( bGrid, bPage );
-}
 aOutputData.DrawClipMarks();
 
 //  Szenario / ChangeTracking muss auf jeden Fall nach DrawGrid sein, auch 
bei !bGridFirst
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-19 Thread Kohei Yoshida
 sc/source/ui/view/viewfun2.cxx |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 4dd59855872736864c24947ca9886af9472e0980
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Thu Jan 19 17:21:31 2012 -0500

Fix a crash when copying a sheet with drawing obj to a new document.

diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index e2c950c..794db51 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -47,6 +47,7 @@
 #include svl/stritem.hxx
 #include svl/zforlist.hxx
 #include svl/svstdarr.hxx
+#include svx/svdview.hxx
 #include vcl/msgbox.hxx
 #include vcl/sound.hxx
 #include vcl/waitobj.hxx
@@ -2466,7 +2467,7 @@ void ScViewFunc::MoveTable(
 sal_Bool bUndo (pDoc-IsUndoEnabled());
 bool bRename = pNewTabName  !pNewTabName-isEmpty();
 
-sal_Bool bNewDoc = ( nDestDocNo == SC_DOC_NEW );
+bool bNewDoc = (nDestDocNo == SC_DOC_NEW);
 if ( bNewDoc )
 {
 nDestTab = 0;   // firstly insert
@@ -2646,7 +2647,16 @@ void ScViewFunc::MoveTable(
 
 pDestDoc-DeleteTab(static_castSCTAB(TheTabs.size()));   // old 
first table
 if (pDestViewSh)
+{
+// Make sure to clear the cached page view after sheet
+// deletion, which still points to the sdr page belonging to
+// the deleted sheet.
+SdrView* pSdrView = pDestViewSh-GetSdrView();
+if (pSdrView)
+pSdrView-ClearPageView();
+
 pDestViewSh-TabChanged();  // Pages auf dem Drawing-Layer
+}
 pDestShell-PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB,
 PAINT_GRID | PAINT_TOP | PAINT_LEFT |
 PAINT_EXTRAS | PAINT_SIZE );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-16 Thread Markus Mohrhard
 sc/source/ui/docshell/docsh5.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 9b7d7322401da8ce42affb9e6bd408311b383ec4
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Jan 15 02:13:39 2012 +

make adjusting formulas possible for TransferTab

diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index d053561..b965d50 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -65,6 +65,7 @@
 #include sc.hrc
 #include waitoff.hxx
 #include sizedev.hxx
+#include clipparam.hxx
 #include basic/sbstar.hxx
 #include basic/basmgr.hxx
 
@@ -850,6 +851,12 @@ sal_uLong ScDocShell::TransferTab( ScDocShell 
rSrcDocShell, SCTAB nSrcPos,
 {
 ScDocument* pSrcDoc = rSrcDocShell.GetDocument();
 
+// set the transfered area to the copyparam to make adjusting formulas 
possible
+ScClipParam aParam;
+ScRange aRange(0, 0, nSrcPos, MAXCOL, MAXROW, nSrcPos);
+aParam.maRanges.Append(aRange);
+pSrcDoc-SetClipParam(aParam);
+
 sal_uLong nErrVal =  aDocument.TransferTab( pSrcDoc, nSrcPos, nDestPos,
 bInsertNew );   // no insert
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-14 Thread David Tardon
 sc/source/ui/inc/anyrefdg.hxx  |   23 +++---
 sc/source/ui/miscdlgs/anyrefdg.cxx |   80 ++---
 2 files changed, 49 insertions(+), 54 deletions(-)

New commits:
commit 4163074e53603f5a068b9b066cfcf840b593b236
Author: David Tardon dtar...@redhat.com
Date:   Fri Jan 13 07:53:08 2012 +0100

refactor slightly to avoid link problems with gcc 4.7

Signed-off-by: David Tardon dtar...@redhat.com

diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx
index 8bca700..afd98e4 100644
--- a/sc/source/ui/inc/anyrefdg.hxx
+++ b/sc/source/ui/inc/anyrefdg.hxx
@@ -121,7 +121,6 @@ class SC_DLLPUBLIC ScRefHandler : //public 
SfxModelessDialog,
 public:
 operator Window *(){ return m_rWindow; }
 Window  * operator -() { return static_castWindow *(*this); }
-templateclass,bool friend class ScRefHdlrImplBase;
 friend classformula::RefButton;
 friend classformula::RefEdit;
 
@@ -152,6 +151,9 @@ protected:
 
 boolParseWithNames( ScRangeList rRanges, const String 
rStr, ScDocument* pDoc );
 
+void preNotify(const NotifyEvent rEvent, const bool bBindRef);
+void stateChanged(const StateChangedType nStateChange, const bool 
bBindRef);
+
 public:
 ScRefHandler( Window rWindow, SfxBindings* pB/*, 
SfxChildWindow* pCW,
  Window* pParent, sal_uInt16 nResId*/, 
bool bBindRef );
@@ -222,6 +224,20 @@ ScRefHdlrImplBaseTWindow,bBindRef::ScRefHdlrImplBase( 
TParentWindow* pParent,
 templateclass TWindow, bool bBindRef 
 ScRefHdlrImplBaseTWindow,bBindRef::~ScRefHdlrImplBase(){}
 
+templateclass TWindow, bool bBindRef
+long ScRefHdlrImplBaseTWindow, bBindRef::PreNotify( NotifyEvent rNEvt )
+{
+ScRefHandler::preNotify( rNEvt, bBindRef );
+return TWindow::PreNotify( rNEvt );
+}
+
+templateclass TWindow, bool bBindRef
+void ScRefHdlrImplBaseTWindow, bBindRef::StateChanged( StateChangedType 
nStateChange )
+{
+TWindow::StateChanged( nStateChange );
+ScRefHandler::stateChanged( nStateChange, bBindRef );
+}
+
 //
 templateclass TDerived, class TBase, bool bBindRef = true
 struct ScRefHdlrImpl: ScRefHdlrImplBaseTBase, bBindRef 
@@ -257,11 +273,6 @@ inline  bool ScRefHandler::CanInputDone( sal_Bool bForced )
 return m_aHelper.CanInputDone( bForced );
 }
 
-template  SC_DLLPUBLIC void 
ScRefHdlrImplBaseSfxModelessDialog,true::StateChanged( StateChangedType 
nStateChange );
-template  SC_DLLPUBLIC long 
ScRefHdlrImplBaseSfxModelessDialog,true::PreNotify( NotifyEvent rNEvt );
-template  SC_DLLPUBLIC void 
ScRefHdlrImplBaseSfxTabDialog,false::StateChanged( StateChangedType 
nStateChange );
-template  SC_DLLPUBLIC long 
ScRefHdlrImplBaseSfxTabDialog,false::PreNotify( NotifyEvent rNEvt );
-
 #endif // SC_ANYREFDG_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx 
b/sc/source/ui/miscdlgs/anyrefdg.cxx
index 25e2f12..42942f2 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -868,54 +868,38 @@ void ScRefHandler::ToggleCollapsed( formula::RefEdit* 
pEdit, formula::RefButton*
 m_aHelper.ToggleCollapsed( pEdit, pButton );
 }
 
-#if defined( _MSC_VER )
-#define INTRODUCE_TEMPLATE
-#else
-#define INTRODUCE_TEMPLATE  template 
-#endif
-
-#define IMPL_TWINDOW_PRENOTIFY( TWindow,bBindRef )  \
-INTRODUCE_TEMPLATE long ScRefHdlrImplBaseTWindow,bBindRef::PreNotify( 
NotifyEvent rNEvt )\
-{\
-if( bBindRef || m_bInRefMode )\
-{\
-sal_uInt16 nSwitch=rNEvt.GetType();\
-if(nSwitch==EVENT_GETFOCUS)\
-{\
-pActiveWin=rNEvt.GetWindow();\
-}\
-}\
-return TWindow::PreNotify(rNEvt);\
-}
-
-#define IMPL_TWINDOW_STATECHANGED( TWindow,bBindRef )   \
-INTRODUCE_TEMPLATE void ScRefHdlrImplBaseTWindow,bBindRef::StateChanged( 
StateChangedType nStateChange )\
-{\
-TWindow::StateChanged( nStateChange );\
-\
-if( !bBindRef  !m_bInRefMode ) return;\
-\
-if(nStateChange == STATE_CHANGE_VISIBLE)\
-{\
-if(m_rWindow.IsVisible())\
-{\
-m_aHelper.enableInput( false );\
-m_aHelper.EnableSpreadsheets();\
-m_aHelper.SetDispatcherLock( sal_True );\
-aTimer.Start();\
-}\
-else\
-{\
-m_aHelper.enableInput( sal_True );\
-m_aHelper.SetDispatcherLock( false );   /*//! here and in 
DoClose ?*/\
-}\
-}\
-}
-
-IMPL_TWINDOW_PRENOTIFY( SfxModelessDialog, true )
-IMPL_TWINDOW_PRENOTIFY( SfxTabDialog, false )
-IMPL_TWINDOW_STATECHANGED( SfxModelessDialog, true )
-IMPL_TWINDOW_STATECHANGED( SfxTabDialog, false )
+void ScRefHandler::preNotify(const NotifyEvent rNEvt, const bool bBindRef)
+{
+if( bBindRef || m_bInRefMode )
+{
+sal_uInt16 nSwitch=rNEvt.GetType();
+if(nSwitch==EVENT_GETFOCUS)
+{

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-12 Thread Jan Holesovsky
 sc/source/core/data/dpsdbtab.cxx |2 +-
 sc/source/core/data/dpshttab.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d6f876434ff957ea6b5fd938fb3b779e4527c63f
Author: Jan Holesovsky ke...@suse.cz
Date:   Fri Jan 13 08:57:46 2012 +0100

Fix MinGW build.

diff --git a/sc/source/core/data/dpsdbtab.cxx b/sc/source/core/data/dpsdbtab.cxx
index 1cfa2f8..576beb5 100644
--- a/sc/source/core/data/dpsdbtab.cxx
+++ b/sc/source/core/data/dpsdbtab.cxx
@@ -140,7 +140,7 @@ void ScDatabaseDPData::CreateCacheTable()
 
 if (!aCacheTable.hasCache())
 {
-fprintf(stdout, ScDatabaseDPData::CreateCacheTable:   NOT GOOD!\n);
+OSL_FAIL(Cache table should be created with a live data cache 
instance at all times.);
 // This better not happen!!  Cache table should be created with a live
 // data cache instance at all times.
 return;
diff --git a/sc/source/core/data/dpshttab.cxx b/sc/source/core/data/dpshttab.cxx
index 14a6f7b..8832b23 100644
--- a/sc/source/core/data/dpshttab.cxx
+++ b/sc/source/core/data/dpshttab.cxx
@@ -192,7 +192,7 @@ void ScSheetDPData::CreateCacheTable()
 
 if (!aCacheTable.hasCache())
 {
-fprintf(stdout, ScSheetDPData::CreateCacheTable:   NOT GOOD!!!\n);
+OSL_FAIL(Cache table should be created with a live data cache 
instance at all times.);
 // This better not happen!!  The cache table should be created with a
 // live data cache at all times.
 return;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-11 Thread Kohei Yoshida
 sc/source/core/data/drwlayer.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 9fae191ea8438777d5c1dd20b20506e131707454
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Wed Jan 11 08:59:49 2012 -0500

Avoid iterating beyond the last existing drawing page.

diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 74c9d35..82fbf7b 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -481,6 +481,15 @@ void ScDrawLayer::ScCopyPage( sal_uInt16 nOldPos, 
sal_uInt16 nNewPos, sal_Bool b
 
 void ScDrawLayer::ResetTab( SCTAB nStart, SCTAB nEnd )
 {
+SCTAB nPageSize = static_castSCTAB(GetPageCount());
+if (nPageSize  0)
+// No drawing pages exist.
+return;
+
+if (nEnd = nPageSize)
+// Avoid iterating beyond the last existing page.
+nEnd = nPageSize - 1;
+
 for (SCTAB i = nStart; i = nEnd; ++i)
 {
 SdrPage* pPage = GetPage(static_castsal_uInt16(i));
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-10 Thread Kohei Yoshida
 sc/source/filter/excel/excform8.cxx |8 +-
 sc/source/filter/excel/read.cxx |1 
 sc/source/filter/excel/xiname.cxx   |  125 +++-
 sc/source/filter/inc/xiname.hxx |   36 --
 sc/source/filter/inc/xistream.hxx   |2 
 5 files changed, 119 insertions(+), 53 deletions(-)

New commits:
commit 4f888c9c01c77500ca181890f69cbd9883324a74
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Tue Jan 10 14:26:14 2012 -0500

fdo#42624: Defer formula token conversion for defined names (xls import).

This is necessary for handling names that cross-reference each other.

diff --git a/sc/source/filter/excel/excform8.cxx 
b/sc/source/filter/excel/excform8.cxx
index f06f9c8..9693fe8 100644
--- a/sc/source/filter/excel/excform8.cxx
+++ b/sc/source/filter/excel/excform8.cxx
@@ -487,11 +487,11 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray* 
rpTokArray, XclImpStream aIn,
 const XclImpName* pName = GetNameManager().GetName( nUINT16 );
 if (pName)
 {
-if (pName-GetScRangeData())
-aStack  aPool.StoreName(nUINT16, pName-IsGlobal());
-else
-// used-defined macro name.
+if (pName-IsMacro())
+// user-defined macro name.
 aStack  aPool.Store(ocMacro, pName-GetXclName());
+else
+aStack  aPool.StoreName(nUINT16, pName-IsGlobal());
 }
 }
 break;
diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx
index 81e6f6a..30acae7 100644
--- a/sc/source/filter/excel/read.cxx
+++ b/sc/source/filter/excel/read.cxx
@@ -1001,6 +1001,7 @@ FltError ImportExcel8::Read( void )
 rNumFmtBfr.CreateScFormats();
 rXFBfr.CreateUserStyles();
 rPTableMgr.ReadPivotCaches( maStrm );
+rNameMgr.ConvertAllTokens();
 eAkt = EXC_STATE_BEFORE_SHEET;
 }
 break;
diff --git a/sc/source/filter/excel/xiname.cxx 
b/sc/source/filter/excel/xiname.cxx
index f2f5e8d..9cdfe77 100644
--- a/sc/source/filter/excel/xiname.cxx
+++ b/sc/source/filter/excel/xiname.cxx
@@ -40,19 +40,26 @@
 // *** Implementation ***
 // 
 
+XclImpName::TokenStrmData::TokenStrmData( XclImpStream rStrm ) :
+mrStrm(rStrm), mnStrmPos(0), mnStrmSize(0) {}
+
 XclImpName::XclImpName( XclImpStream rStrm, sal_uInt16 nXclNameIdx ) :
 XclImpRoot( rStrm.GetRoot() ),
 mpScData( 0 ),
 mcBuiltIn( EXC_BUILTIN_UNKNOWN ),
 mnScTab( SCTAB_MAX ),
-mbFunction( false ),
-mbVBName( false )
+meNameType( RT_NAME ),
+mnXclTab( EXC_NAME_GLOBAL ),
+mnNameIndex( nXclNameIdx ),
+mbVBName( false ),
+mbMacro( false ),
+mpTokensData( NULL )
 {
 ExcelToSc rFmlaConv = GetOldFmlaConverter();
 
 // 1) *** read data from stream *** ---
 
-sal_uInt16 nFlags = 0, nFmlaSize = 0, nExtSheet = EXC_NAME_GLOBAL, nXclTab 
= EXC_NAME_GLOBAL;
+sal_uInt16 nFlags = 0, nFmlaSize = 0, nExtSheet = EXC_NAME_GLOBAL;
 sal_uInt8 nNameLen = 0, nShortCut;
 
 switch( GetBiff() )
@@ -78,7 +85,7 @@ XclImpName::XclImpName( XclImpStream rStrm, sal_uInt16 
nXclNameIdx ) :
 case EXC_BIFF5:
 case EXC_BIFF8:
 {
-rStrm  nFlags  nShortCut  nNameLen  nFmlaSize  nExtSheet 
 nXclTab;
+rStrm  nFlags  nShortCut  nNameLen  nFmlaSize  nExtSheet 
 mnXclTab;
 rStrm.Ignore( 4 );
 }
 break;
@@ -94,8 +101,9 @@ XclImpName::XclImpName( XclImpStream rStrm, sal_uInt16 
nXclNameIdx ) :
 // 2) *** convert sheet index and name *** 
 
 // functions and VBA
-mbFunction = ::get_flag( nFlags, EXC_NAME_FUNC );
+bool bFunction = ::get_flag( nFlags, EXC_NAME_FUNC );
 mbVBName = ::get_flag( nFlags, EXC_NAME_VB );
+mbMacro = ::get_flag( nFlags, EXC_NAME_PROC );
 
 // get built-in name, or convert characters invalid in Calc
 bool bBuiltIn = ::get_flag( nFlags, EXC_NAME_BUILTIN );
@@ -131,11 +139,9 @@ XclImpName::XclImpName( XclImpStream rStrm, sal_uInt16 
nXclNameIdx ) :
 rtl::OUString aRealOrigName = maScName;
 
 // add index for local names
-if( nXclTab != EXC_NAME_GLOBAL )
+if( mnXclTab != EXC_NAME_GLOBAL )
 {
-sal_uInt16 nUsedTab = (GetBiff() == EXC_BIFF8) ? nXclTab : nExtSheet;
-// do not rename sheet-local names by default, this breaks VBA scripts
-//maScName.Append( '_' ).Append( String::CreateFromInt32( nUsedTab ) );
+sal_uInt16 nUsedTab = (GetBiff() == EXC_BIFF8) ? mnXclTab : nExtSheet;
 // TODO: may not work for BIFF5, handle skipped sheets (all BIFF)
 

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-10 Thread Kohei Yoshida
 sc/source/filter/excel/read.cxx   |6 ++
 sc/source/filter/excel/xiname.cxx |2 ++
 2 files changed, 8 insertions(+)

New commits:
commit 00c5189e092b74c118e03bdff4578b4de95378ad
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Tue Jan 10 14:47:35 2012 -0500

fdo#42624: Do the same for BIFF5 and earlier.

diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx
index 30acae7..4f0ce42 100644
--- a/sc/source/filter/excel/read.cxx
+++ b/sc/source/filter/excel/read.cxx
@@ -238,6 +238,7 @@ FltError ImportExcel::Read( void )
 case 0x08:  Row25(); break; // ROW  [ 2  5]
 case 0x0A:  // EOF  [ 2345]
 rNumFmtBfr.CreateScFormats();
+rNameMgr.ConvertAllTokens();
 Eof();
 eAkt = Z_Ende;
 break;
@@ -300,6 +301,7 @@ FltError ImportExcel::Read( void )
 
 case 0x0A:  // EOF  [ 2345]
 rNumFmtBfr.CreateScFormats();
+rNameMgr.ConvertAllTokens();
 Eof();
 eAkt = Z_Ende;
 break;
@@ -370,6 +372,7 @@ FltError ImportExcel::Read( void )
 
 case 0x0A:  // EOF  [ 2345]
 rNumFmtBfr.CreateScFormats();
+rNameMgr.ConvertAllTokens();
 Eof();
 eAkt = Z_Ende;
 break;
@@ -424,6 +427,7 @@ FltError ImportExcel::Read( void )
 switch( nOpcode )
 {
 case 0x0A:  // EOF  [ 2345]
+rNameMgr.ConvertAllTokens();
 eAkt = Z_Ende;
 break;
 case 0x12:  DocProtect(); break;// PROTECT  [5]
@@ -487,6 +491,7 @@ FltError ImportExcel::Read( void )
 case EXC_ID_RK: ReadRk();   break;
 
 case 0x0A:  // EOF  [ 2345]
+rNameMgr.ConvertAllTokens();
 Eof();
 eAkt = Z_Biff4E;
 break;
@@ -584,6 +589,7 @@ FltError ImportExcel::Read( void )
 case 0x0A:  // EOF  [ 2345]
 rNumFmtBfr.CreateScFormats();
 rXFBfr.CreateUserStyles();
+rNameMgr.ConvertAllTokens();
 eAkt = Z_Biff5E;
 break;
 case 0x18:  rNameMgr.ReadName( maStrm );break;
diff --git a/sc/source/filter/excel/xiname.cxx 
b/sc/source/filter/excel/xiname.cxx
index 9cdfe77..00f0d42 100644
--- a/sc/source/filter/excel/xiname.cxx
+++ b/sc/source/filter/excel/xiname.cxx
@@ -240,6 +240,8 @@ void XclImpName::ConvertTokens()
 
 if (pArray)
 InsertName(pArray);
+
+mpTokensData.reset();
 }
 
 void XclImpName::InsertName(const ScTokenArray* pArray)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-10 Thread Kohei Yoshida
 sc/source/filter/html/htmlexp.cxx |   10 --
 1 file changed, 10 deletions(-)

New commits:
commit e882d40de210e3e98a546e89ff7701653c33f1d8
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Wed Jan 11 01:28:29 2012 +0900

fdo#44616: drop attributes FRAME and RULES of table for HTML 3.2

This fixes fdo#44616.
HTML 3.2 does not have these attributes:
http://www.w3.org/TR/REC-html32

diff --git a/sc/source/filter/html/htmlexp.cxx 
b/sc/source/filter/html/htmlexp.cxx
index 0c27b45..1f36f9d 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -735,11 +735,6 @@ void ScHTMLExport::WriteTables()
 // TABLE ...
 rtl::OStringBuffer aByteStrOut(OOO_STRING_SVTOOLS_HTML_table);
 
-// FRAME=VOID, we do the styling of the cells in TD
-aByteStrOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_frame).
-append(RTL_CONSTASCII_STRINGPARAM(=\)).
-append(OOO_STRING_SVTOOLS_HTML_TF_void).append('');
-
 bTabHasGraphics = bTabAlignedLeft = false;
 if ( bAll  pDrawLayer )
 PrepareGraphics( pDrawLayer, nTab, nStartCol, nStartRow,
@@ -769,11 +764,6 @@ void ScHTMLExport::WriteTables()
 append(RTL_CONSTASCII_STRINGPARAM(=\)).
 append(static_castsal_Int32(nColCnt)).append('');
 
-// RULES=NONE, we do the styling of the cells in TD
-aByteStrOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_rules).
-append(RTL_CONSTASCII_STRINGPARAM(=\)).
-append(OOO_STRING_SVTOOLS_HTML_TR_none).append('');
-
 // BORDER=0, we do the styling of the cells in TD
 aByteStrOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_border).
 append(RTL_CONSTASCII_STRINGPARAM(=\0\));
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-10 Thread Kohei Yoshida
 sc/source/ui/view/viewdata.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit a78260fb65c2542566215bb5bdd6060c164584ab
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Tue Jan 10 22:25:06 2012 -0500

fdo#44147: Sheet 0 is selected by default.

ScViewData's default ctor sets current sheet to 0, but its selected
sheet data didn't have it selected which meant that the two data
were out-of-sync when created.  This affected entering data into cell
when the sheet was embedded (because no sheet was selected).  In
reality at least one sheet is selected at all times.

The above bug was present before, but was masked by a hack in ScTabView
which always selected sheet 0 when activated.  I removed that because
it was interfering with syncing the sheet selection data before and
after print preview.  And removing that hack exposed this.

This commit is the right fix.

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 691b651..26c6346 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -322,6 +322,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* 
pViewSh ) :
 bPagebreak  ( false ),
 bSelCtrlMouseClick( false )
 {
+mpMarkData-SelectOneTable(0); // Sync with nTabNo.
 
 SetGridMode ( sal_True );
 SetSyntaxMode   ( false );
@@ -368,6 +369,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* 
pViewSh ) :
 
 ScViewData::ScViewData( const ScViewData rViewData ) :
 maTabData( rViewData.maTabData ),
+mpMarkData(new ScMarkData(*rViewData.mpMarkData)),
 pDocShell   ( rViewData.pDocShell ),
 pDoc( rViewData.pDoc ),
 pView   ( rViewData.pView ),
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-08 Thread Kohei Yoshida
 sc/source/core/data/drwlayer.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit 7842c9a9734255b512e624865d7101c2599728d4
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Sun Jan 8 16:41:57 2012 -0500

Handle resizing of cell-anchored polyline objects as well.

This should take care of correctly resizing cell-anchored polyline
objects when resizing row height / column width.

diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index cdbb95d..74c9d35 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -794,6 +794,17 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, 
ScDrawObjData rData, bool bNegati
 if (bRecording)
 AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
 rData.maLastRect = lcl_makeSafeRectangle(aNew);
+if (pObj-IsPolyObj())
+{
+// Polyline objects need special treatment.
+Size aSizeMove(aNew.Left()-aOld.Left(), 
aNew.Top()-aOld.Top());
+pObj-NbcMove(aSizeMove);
+
+double fXFrac = static_castdouble(aNew.GetWidth()) / 
static_castdouble(aOld.GetWidth());
+double fYFrac = static_castdouble(aNew.GetHeight()) / 
static_castdouble(aOld.GetHeight());
+pObj-NbcResize(aNew.TopLeft(), Fraction(fXFrac), 
Fraction(fYFrac));
+}
+
 pObj-SetLogicRect(rData.maLastRect);
 }
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-07 Thread Kohei Yoshida
 sc/source/core/data/documen9.cxx |2 +-
 sc/source/core/data/table1.cxx   |3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 6b7080c102e56651803831aaa12c3c86efbce858
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Sat Jan 7 18:18:15 2012 -0500

Reset sheet ID of cell-anchored drawing objects when deleting sheet(s).

This prevents drawing objects from disappearing on file reload.

diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index e4dec4f..d701597 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -257,7 +257,7 @@ void ScDocument::DrawCopyPage( sal_uInt16 nOldPos, 
sal_uInt16 nNewPos )
 {
 // angelegt wird die Page schon im ScTable ctor
 pDrawLayer-ScCopyPage( nOldPos, nNewPos, false );
-pDrawLayer-ResetTab(static_castSCTAB(nNewPos), 
static_castSCTAB(maTabs.size()));
+pDrawLayer-ResetTab(static_castSCTAB(nNewPos), 
static_castSCTAB(maTabs.size()-1));
 }
 
 void ScDocument::DeleteObjectsInArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, 
SCROW nRow2,
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 06b8203..2464340 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -331,7 +331,10 @@ ScTable::~ScTable()
 
 ScDrawLayer* pDrawLayer = pDocument-GetDrawLayer();
 if (pDrawLayer)
+{
 pDrawLayer-ScRemovePage( nTab );
+pDrawLayer-ResetTab(nTab, pDocument-GetTableCount()-1);
+}
 }
 
 delete[] pColWidth;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-06 Thread Andras Timar
 sc/source/ui/inc/anyrefdg.hxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit cf31d38e36690c21fba0c218847bb89e1395df19
Author: Korrawit Pruegsanusak detective.conan.1...@gmail.com
Date:   Wed Dec 21 21:50:46 2011 +0700

Revert this to build on msvc 2008

diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx
index ef44b61..8bca700 100644
--- a/sc/source/ui/inc/anyrefdg.hxx
+++ b/sc/source/ui/inc/anyrefdg.hxx
@@ -189,7 +189,7 @@ public:
 //
 
 template  class TWindow, bool bBindRef = true 
-class SC_DLLPUBLIC ScRefHdlrImplBase:public TWindow, public ScRefHandler
+class ScRefHdlrImplBase:public TWindow, public ScRefHandler
 {
 public:
 //Overwrite TWindow
@@ -211,16 +211,16 @@ private:
 
 templateclass TWindow, bool bBindRef
 templateclass TBindings, class TChildWindow, class TParentWindow, class 
TResId
-SC_DLLPUBLIC ScRefHdlrImplBaseTWindow, bBindRef::ScRefHdlrImplBase( 
TBindings* pB, TChildWindow* pCW,
+ScRefHdlrImplBaseTWindow, bBindRef::ScRefHdlrImplBase( TBindings* pB, 
TChildWindow* pCW,
  TParentWindow* pParent, TResId nResId):TWindow(pB, pCW, 
pParent, ScResId(static_castsal_uInt16( nResId ) ) ), ScRefHandler( 
*static_castTWindow*(this), pB, bBindRef ){}
 
 templateclass TWindow, bool bBindRef 
 templateclass TParentWindow, class TResId, class TArg
-SC_DLLPUBLIC ScRefHdlrImplBaseTWindow,bBindRef::ScRefHdlrImplBase( 
TParentWindow* pParent, TResId nResIdP, const TArg rArg, SfxBindings *pB /*= 
NULL*/ )
+ScRefHdlrImplBaseTWindow,bBindRef::ScRefHdlrImplBase( TParentWindow* 
pParent, TResId nResIdP, const TArg rArg, SfxBindings *pB /*= NULL*/ )
 :TWindow( pParent, ScResId(static_castsal_uInt16( nResIdP )), rArg ), 
ScRefHandler( *static_castTWindow*(this), pB, bBindRef ){}
 
 templateclass TWindow, bool bBindRef 
-SC_DLLPUBLIC ScRefHdlrImplBaseTWindow,bBindRef::~ScRefHdlrImplBase(){}
+ScRefHdlrImplBaseTWindow,bBindRef::~ScRefHdlrImplBase(){}
 
 //
 templateclass TDerived, class TBase, bool bBindRef = true
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-06 Thread Kohei Yoshida
 sc/source/core/data/document.cxx |   30 ++
 1 file changed, 18 insertions(+), 12 deletions(-)

New commits:
commit 225d19808800785e3f4ad2b9b8e37f5f9397cf15
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Fri Jan 6 20:56:20 2012 -0500

fdo#44467: Deleting sheets should adjust drawing object pages as well.

Good thing we caught this, because we were also leaking memory by not
deleting the deleted sheet instances.

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index eb03a74..15d5295 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -95,6 +95,7 @@
 #include externalrefmgr.hxx
 #include tabprotection.hxx
 #include clipparam.hxx
+#include stlalgorithm.hxx
 
 #include map
 #include limits
@@ -651,17 +652,19 @@ bool ScDocument::DeleteTab( SCTAB nTab, ScDocument* 
pRefUndoDoc )
 if ( pUnoBroadcaster )
 pUnoBroadcaster-Broadcast( ScUpdateRefHint( URM_INSDEL, 
aRange, 0,0,-1 ) );
 
-SCTAB i;
-for (i=0; i static_castSCTAB(maTabs.size()); i++)
+for (SCTAB i = 0, n = static_castSCTAB(maTabs.size()); i  
n; ++i)
 if (maTabs[i])
-maTabs[i]-UpdateDeleteTab(nTab,false,
-pRefUndoDoc ? pRefUndoDoc-maTabs[i] : 0);
-maTabs.erase(maTabs.begin()+ nTab);
+maTabs[i]-UpdateDeleteTab(
+nTab, false, pRefUndoDoc ? pRefUndoDoc-maTabs[i] 
: 0);
+
+TableContainer::iterator it = maTabs.begin() + nTab;
+delete *it;
+maTabs.erase(it);
 // UpdateBroadcastAreas must be called between UpdateDeleteTab,
 // which ends listening, and StartAllListeners, to not modify
 // areas that are to be inserted by starting listeners.
 UpdateBroadcastAreas( URM_INSDEL, aRange, 0,0,-1);
-TableContainer::iterator it = maTabs.begin();
+it = maTabs.begin();
 for (; it != maTabs.end(); ++it)
 if ( *it )
 (*it)-UpdateCompile();
@@ -738,17 +741,20 @@ bool ScDocument::DeleteTabs( SCTAB nTab, SCTAB nSheets, 
ScDocument* pRefUndoDoc
 if ( pUnoBroadcaster )
 pUnoBroadcaster-Broadcast( ScUpdateRefHint( URM_INSDEL, 
aRange, 0,0,-1*nSheets ) );
 
-SCTAB i;
-for (i=0; i static_castSCTAB(maTabs.size()); i++)
+for (SCTAB i = 0, n = static_castSCTAB(maTabs.size()); i  
n; ++i)
 if (maTabs[i])
-maTabs[i]-UpdateDeleteTab(nTab,false,
-pRefUndoDoc ? pRefUndoDoc-maTabs[i] : 
0,nSheets);
-maTabs.erase(maTabs.begin()+ nTab, maTabs.begin() + nTab + 
nSheets);
+maTabs[i]-UpdateDeleteTab(
+nTab, false, pRefUndoDoc ? pRefUndoDoc-maTabs[i] 
: 0,nSheets);
+
+TableContainer::iterator it = maTabs.begin() + nTab;
+TableContainer::iterator itEnd = it + nSheets;
+std::for_each(it, itEnd, ScDeleteObjectByPtrScTable());
+maTabs.erase(it, itEnd);
 // UpdateBroadcastAreas must be called between UpdateDeleteTab,
 // which ends listening, and StartAllListeners, to not modify
 // areas that are to be inserted by starting listeners.
 UpdateBroadcastAreas( URM_INSDEL, aRange, 0,0,-1*nSheets);
-TableContainer::iterator it = maTabs.begin();
+it = maTabs.begin();
 for (; it != maTabs.end(); ++it)
 if ( *it )
 (*it)-UpdateCompile();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-06 Thread Kohei Yoshida
 sc/source/core/tool/interpr1.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 9199fedb8e20133782a081ac1c33a67d06dffbc6
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Fri Jan 6 22:19:16 2012 -0500

fdo#36387: Get external references to work with AND and OR.

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index a76d2b6..dcdc5fe 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -1246,6 +1246,8 @@ void ScInterpreter::ScAnd()
 }
 }
 break;
+case svExternalSingleRef:
+case svExternalDoubleRef:
 case svMatrix:
 {
 ScMatrixRef pMat = GetMatrix();
@@ -1344,6 +1346,8 @@ void ScInterpreter::ScOr()
 }
 }
 break;
+case svExternalSingleRef:
+case svExternalDoubleRef:
 case svMatrix:
 {
 bHaveValue = true;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-06 Thread Kohei Yoshida
 sc/source/core/data/document.cxx |7 ---
 1 file changed, 7 deletions(-)

New commits:
commit 34b8ee9b1cc7657fbdcad36cd29971038d2c6e6c
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Sat Jan 7 00:14:35 2012 -0500

Removing debug statements.

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 15d5295..61fdbe5 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -100,9 +100,6 @@
 #include map
 #include limits
 
-#include rtl/oustringostreaminserter.hxx
-#include iostream
-
 using ::editeng::SvxBorderLine;
 using namespace ::com::sun::star;
 
@@ -1729,11 +1726,7 @@ void ScDocument::InitUndo( ScDocument* pSrcDoc, SCTAB 
nTab1, SCTAB nTab2,
 
 xPoolHelper = pSrcDoc-xPoolHelper;
 if (pSrcDoc-pShell-GetMedium())
-{
 maFileURL = 
pSrcDoc-pShell-GetMedium()-GetURLObject().GetMainURL(INetURLObject::DECODE_TO_IURI);
-std::cout  SfxMedium:   maFileURL  std::endl;
-std::cout  GetName:   
rtl::OUString(pSrcDoc-pShell-GetName())  std::endl;
-}
 
 rtl::OUString aString;
 if ( nTab2 = static_castSCTAB(maTabs.size()))
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-05 Thread Kohei Yoshida
 sc/source/ui/inc/tabview.hxx   |9 +
 sc/source/ui/view/tabview.cxx  |9 +
 sc/source/ui/view/tabview3.cxx |  199 +++--
 sc/source/ui/view/tabview5.cxx |2 
 4 files changed, 163 insertions(+), 56 deletions(-)

New commits:
commit a6dc4b7a1e2fcbe478bc7feae06bc9ff24b26aaf
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Thu Jan 5 22:13:52 2012 -0500

fdo#36851, bnc#737190: Make the data validation popup more reliable.

Previously, the data validation message popup was not sticking on
reliably on Linux, and flickers very bad on Windows.  That was due to
the painting conflict between the top-most frame window and the grid
window.  By making the message popup window a child window of the
grid window, it paints more reliably.

diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index c356379..09244bb 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -36,6 +36,9 @@
 #include viewutil.hxx
 #include select.hxx
 
+#include boost/noncopyable.hpp
+#include boost/scoped_ptr.hpp
+
 class ScEditEngineDefaulter;
 class ScGridWindow;
 class ScOutlineWindow;
@@ -89,7 +92,7 @@ public:
 
 // ---
 
-class ScTabView
+class ScTabView : boost::noncopyable
 {
 private:
 enum BlockMode { None = 0, Normal = 1, Own = 2 };
@@ -129,7 +132,7 @@ private:
 ScCornerButton  aTopButton;
 ScrollBarBoxaScrollBarBox;
 
-ScHintWindow*   pInputHintWindow;   // Eingabemeldung bei 
Gueltigkeit
+boost::scoped_ptrScHintWindow mpInputHintWindow; // popup window for 
data validation
 
 ScPageBreakData*pPageBreakData; // fuer Seitenumbruch-Modus
 std::vectorScHighlightEntry   maHighlightRanges;
@@ -243,7 +246,7 @@ public:
 
 voidHideListBox();
 
-boolHasHintWindow() const   { return pInputHintWindow != NULL; 
}
+boolHasHintWindow() const;
 voidRemoveHintWindow();
 voidTestHintWindow();
 
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index bba84cd..6d1652f 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -142,6 +142,7 @@
 #include AccessibilityHints.hxx
 #include appoptio.hxx
 #include attrib.hxx
+#include hintwin.hxx
 
 #include com/sun/star/sheet/DataPilotFieldOrientation.hpp
 
@@ -307,7 +308,7 @@ ScTabView::ScTabView( Window* pParent, ScDocShell rDocSh, 
ScTabViewShell* pView
 aCornerButton( pFrameWin, aViewData, false ),
 aTopButton( pFrameWin, aViewData, sal_True ),
 aScrollBarBox( pFrameWin, WB_SIZEABLE ),
-pInputHintWindow( NULL ),
+mpInputHintWindow( NULL ),
 pPageBreakData( NULL ),
 pBrushDocument( NULL ),
 pDrawBrushSet( NULL ),
@@ -390,7 +391,7 @@ void ScTabView::DoResize( const Point rOffset, const Size 
rSize, bool bInner )
 {
 HideListBox();
 
-bool bHasHint = ( pInputHintWindow != NULL );
+bool bHasHint = HasHintWindow();
 if (bHasHint)
 RemoveHintWindow();
 
@@ -1300,7 +1301,7 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll )
 
 void ScTabView::ScrollX( long nDeltaX, ScHSplitPos eWhich, bool bUpdBars )
 {
-sal_Bool bHasHint = ( pInputHintWindow != NULL );
+bool bHasHint = HasHintWindow();
 if (bHasHint)
 RemoveHintWindow();
 
@@ -1389,7 +1390,7 @@ void ScTabView::ScrollX( long nDeltaX, ScHSplitPos 
eWhich, bool bUpdBars )
 
 void ScTabView::ScrollY( long nDeltaY, ScVSplitPos eWhich, bool bUpdBars )
 {
-sal_Bool bHasHint = ( pInputHintWindow != NULL );
+bool bHasHint = HasHintWindow();
 if (bHasHint)
 RemoveHintWindow();
 
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 556d3bf..a8fd507 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -359,7 +359,6 @@ void ScTabView::CellContentChanged()
 rBindings.Invalidate( SID_HYPERLINK_GETLINK );
 
 InvalidateAttribs();// Attribut-Updates
-TestHintWindow();   // Eingabemeldung (Gueltigkeit)
 
 aViewData.GetViewShell()-UpdateInputHandler();
 }
@@ -470,6 +469,135 @@ void ScTabView::CursorPosChanged()
 aViewData.SetTabStartCol( SC_TABSTART_NONE );
 }
 
+namespace {
+
+Point calcHintWindowPosition(
+const Point rCellPos, const Size rCellSize, const Size rFrameWndSize, 
const Size rHintWndSize)
+{
+const long nMargin = 20;
+
+long nMLeft = rCellPos.X();
+long nMRight = rFrameWndSize.Width() - rCellPos.X() - rCellSize.Width();
+long nMTop = rCellPos.Y();
+long nMBottom = rFrameWndSize.Height() - rCellPos.Y() - rCellSize.Height();
+
+// First, see if we can fit the entire hint window in the visible region.
+
+if (nMRight - nMargin = rHintWndSize.Width())
+{
+// Right margin is wide enough.
+if (rFrameWndSize.Height() = 

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-01-04 Thread Kohei Yoshida
 sc/source/core/data/documen5.cxx  |4 ++--
 sc/source/core/tool/charthelper.cxx   |2 --
 sc/source/core/tool/rangeutl.cxx  |   13 +++--
 sc/source/filter/excel/xichart.cxx|2 +-
 sc/source/filter/xml/XMLTableShapeResizer.cxx |4 ++--
 sc/source/ui/unoobj/chart2uno.cxx |   10 ++
 6 files changed, 14 insertions(+), 21 deletions(-)

New commits:
commit 0c47ce165d56c13abea1e78f4feeed6c3dd3f59b
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Thu Jan 5 00:25:40 2012 -0500

Removed the restriction to always pass Calc A1 formatted data ranges.

This change also fixes the bug where changing data series ranges was
impossible to do when the formula syntax was not Calc A1.

diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx
index 4a1c2b4..f19a067 100644
--- a/sc/source/core/data/documen5.cxx
+++ b/sc/source/core/data/documen5.cxx
@@ -297,8 +297,8 @@ void ScDocument::SetChartRanges( const rtl::OUString 
rChartName, const ::std::v
 for( sal_Int32 nN=0; nNnCount; nN++ )
 {
 ScRangeList aScRangeList( rRangesVector[nN] );
-rtl::OUString sRangeStr; // This range must be in Calc A1 format.
-aScRangeList.Format( sRangeStr, SCR_ABS_3D, this );
+rtl::OUString sRangeStr;
+aScRangeList.Format( sRangeStr, SCR_ABS_3D, this, 
GetAddressConvention() );
 aRangeStrings[nN]=sRangeStr;
 }
 ScChartHelper::SetChartRanges( xChartDoc, aRangeStrings );
diff --git a/sc/source/core/tool/charthelper.cxx 
b/sc/source/core/tool/charthelper.cxx
index e1f0500..6cd84f1 100644
--- a/sc/source/core/tool/charthelper.cxx
+++ b/sc/source/core/tool/charthelper.cxx
@@ -248,7 +248,6 @@ void ScChartHelper::SetChartRanges( const uno::Reference 
chart2::XChartDocument
 
 if( xLabel.is())
 {
-// the range string must be in Calc A1 format.
 uno::Reference chart2::data::XDataSequence  xNewSeq(
 xDataProvider-createDataSequenceByRangeRepresentation( 
rRanges[nRange++] ));
 
@@ -264,7 +263,6 @@ void ScChartHelper::SetChartRanges( const uno::Reference 
chart2::XChartDocument
 
 if( xValues.is())
 {
-// the range string must be in Calc A1 format.
 uno::Reference chart2::data::XDataSequence  xNewSeq(
 xDataProvider-createDataSequenceByRangeRepresentation( 
rRanges[nRange++] ));
 
diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx
index 5e1db5d..572ff17 100644
--- a/sc/source/core/tool/rangeutl.cxx
+++ b/sc/source/core/tool/rangeutl.cxx
@@ -834,13 +834,13 @@ static void lcl_appendCellAddress(
 rBuf.append(sal_Unicode('.'));
 
 String aAddr;
-rCell.Format(aAddr, SCA_ABS, NULL, 
::formula::FormulaGrammar::CONV_OOO);
+rCell.Format(aAddr, SCA_ABS, NULL, pDoc-GetAddressConvention());
 rBuf.append(aAddr);
 }
 else
 {
 String aAddr;
-rCell.Format(aAddr, SCA_ABS_3D, pDoc, 
::formula::FormulaGrammar::CONV_OOO);
+rCell.Format(aAddr, SCA_ABS_3D, pDoc, pDoc-GetAddressConvention());
 rBuf.append(aAddr);
 }
 }
@@ -869,7 +869,7 @@ static void lcl_appendCellRangeAddress(
 rBuf.append(sal_Unicode('.'));
 
 String aAddr;
-rCell1.Format(aAddr, SCA_ABS, NULL, 
::formula::FormulaGrammar::CONV_OOO);
+rCell1.Format(aAddr, SCA_ABS, NULL, pDoc-GetAddressConvention());
 rBuf.append(aAddr);
 
 rBuf.appendAscii(:);
@@ -881,7 +881,7 @@ static void lcl_appendCellRangeAddress(
 rBuf.append(sal_Unicode('.'));
 }
 
-rCell2.Format(aAddr, SCA_ABS, NULL, 
::formula::FormulaGrammar::CONV_OOO);
+rCell2.Format(aAddr, SCA_ABS, NULL, pDoc-GetAddressConvention());
 rBuf.append(aAddr);
 }
 else
@@ -890,7 +890,7 @@ static void lcl_appendCellRangeAddress(
 aRange.aStart = rCell1;
 aRange.aEnd   = rCell2;
 String aAddr;
-aRange.Format(aAddr, SCR_ABS_3D, pDoc, 
::formula::FormulaGrammar::CONV_OOO);
+aRange.Format(aAddr, SCR_ABS_3D, pDoc, pDoc-GetAddressConvention());
 rBuf.append(aAddr);
 }
 }
@@ -898,7 +898,8 @@ static void lcl_appendCellRangeAddress(
 void ScRangeStringConverter::GetStringFromXMLRangeString( OUString rString, 
const OUString rXMLRange, ScDocument* pDoc )
 {
 FormulaGrammar::AddressConvention eConv = pDoc-GetAddressConvention();
-const sal_Unicode cSep = ' ', cSepNew = ';';
+const sal_Unicode cSep = ' ';
+const sal_Unicode cSepNew = ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
 const sal_Unicode cQuote = '\'';
 
 OUStringBuffer aRetStr;
diff --git a/sc/source/filter/excel/xichart.cxx 
b/sc/source/filter/excel/xichart.cxx
index 5ae9215..8cf884d 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ 

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2011-12-23 Thread Markus Mohrhard
 sc/source/ui/app/transobj.cxx  |4 
 sc/source/ui/view/viewfun3.cxx |   19 ---
 2 files changed, 4 insertions(+), 19 deletions(-)

New commits:
commit 49a1737b7d3d61304e749c6c164165b8bf68790e
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Dec 23 08:58:17 2011 +0100

fix copy/paste with whole column/row

this fix should restore the old copy/paste behavior in calc and still
only paste relevant entries to external programs

diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index c923fd6..a61e5d3 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -61,6 +61,7 @@
 #include scmod.hxx
 #include dragdata.hxx
 #include clipdata.hxx
+#include clipparam.hxx
 
 // for InitDocShell
 #include editeng/paperinf.hxx
@@ -171,6 +172,9 @@ ScTransferObj::ScTransferObj( ScDocument* pClipDoc, const 
TransferableObjectDesc
 }
 OSL_ENSURE(!bFirst, no sheet selected);
 
+if (!pDoc-GetClipParam().isMultiRange()  nTab1 == nTab2)
+pDoc-ShrinkToDataArea( nTab1, nCol1, nRow1, nCol2, nRow2 );
+
 //  only limit to used cells if whole sheet was marked
 //  (so empty cell areas can be copied)
 if ( nCol2=MAXCOL  nRow2=MAXROW )
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 68ccf21..bd13314 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -277,28 +277,9 @@ sal_Bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, 
sal_Bool bCut, sal_Bool b
 {
 ScRange aRange;
 ScMarkType eMarkType = GetViewData()-GetSimpleArea( aRange );
-ScDocument* pDoc = GetViewData()-GetDocument();
 ScMarkData rMark = GetViewData()-GetMarkData();
 sal_Bool bDone = sal_False;
 
-if( !pClipDoc ) // System Copy - adjust the ranges.
-{
-SCCOL nCol1 = aRange.aStart.Col();
-SCCOL nCol2 = aRange.aEnd.Col();
-SCROW nRow1 = aRange.aStart.Row();
-SCROW nRow2 = aRange.aEnd.Row();
-pDoc-ShrinkToDataArea( aRange.aStart.Tab(), nCol1, nRow1, nCol2, 
nRow2 );
-if( aRange.aStart.Col() == 0  aRange.aEnd.Col() == MAXCOL )
-{
-aRange.aStart.SetCol( nCol1 );
-aRange.aEnd.SetCol( nCol2 );
-}
-if( aRange.aStart.Row() == 0  aRange.aEnd.Row() == MAXROW )
-{
-aRange.aStart.SetRow( nRow1 );
-aRange.aEnd.SetRow( nRow2 );
-}
-}
 if ( eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED )
 {
ScRangeList aRangeList;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2011-12-17 Thread Christian Lohmaier
 sc/source/ui/unoobj/filtuno.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 47a941847617fd232dc48947b82f2b6a9830a895
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Fri Dec 16 12:39:39 2011 -0600

WaE Mac unitialized value false positive

diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx
index 6c1a651..4fe9f0f 100644
--- a/sc/source/ui/unoobj/filtuno.cxx
+++ b/sc/source/ui/unoobj/filtuno.cxx
@@ -82,7 +82,7 @@ SC_SIMPLE_SERVICE_INFO( ScFilterOptionsObj, 
SCFILTEROPTIONSOBJ_IMPLNAME, SCFILTE
 
 static void load_CharSet( rtl_TextEncoding nCharSet, bool bExport )
 {
-sal_Int32 nChar;
+sal_Int32 nChar = 0;
 SequenceAny aValues;
 const Any *pProperties;
 SequenceOUString aNames(1);
@@ -101,7 +101,9 @@ static void load_CharSet( rtl_TextEncoding nCharSet, bool 
bExport )
 {
 pProperties[0] = nChar;
 if( nChar = 0)
+{
 nCharSet = (rtl_TextEncoding) nChar;
+}
 }
 }
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2011-12-15 Thread Muthu Subramanian
 sc/source/filter/excel/impop.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit cb010c378dfb60fa82a3dfbcd1bcd20e5b26df48
Author: Muthu Subramanian sumu...@suse.com
Date:   Thu Dec 15 16:49:52 2011 +0530

fdo#33747: Row Height is unnecessarily large.

diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index 3c96481..533bbb9 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -937,6 +937,10 @@ void ImportExcel::Row34( void )
 aIn  nRowHeight;  // direkt in Twips angegeben
 aIn.Ignore( 4 );
 
+nRowHeight = nRowHeight  0x7FFF; // Bit 15: Row Height not changed 
manually
+if( !nRowHeight )
+nRowHeight = (GetBiff() == EXC_BIFF2) ? 0x25 : 0x225;
+
 aIn  nGrbit  nXF;
 
 sal_uInt8 nLevel = ::extract_value sal_uInt8 ( nGrbit, 0, 3 );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2011-12-15 Thread Eike Rathke
 sc/source/filter/xml/XMLStylesExportHelper.cxx |   85 +
 1 file changed, 72 insertions(+), 13 deletions(-)

New commits:
commit 4362f16588dd5937dedd4922af1714aa949ecdba
Author: Eike Rathke er...@redhat.com
Date:   Thu Dec 15 16:09:30 2011 +0100

Resolves fdo#43725 crash on saving a file

+ Checks out-of-bounds accesses in
  ScFormatRangeStyles::GetStyleNameIndex() and
  ScRowFormatRanges::AddRange() and prevents crashes.
- The real cause seems to be some style row/repeat miscalculation
  elsewhere, further investigation would be necessary.

diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx 
b/sc/source/filter/xml/XMLStylesExportHelper.cxx
index 83a3fca..1c7897f 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
@@ -677,10 +677,35 @@ void ScRowFormatRanges::AddRange(ScMyRowFormatRange 
rFormatRange,
 const sal_Int32 nRow)
 {
 OSL_ENSURE(pRowDefaults, no row defaults);
+if (!pRowDefaults)
+return;
 OSL_ENSURE(pColDefaults, no column defaults);
+if (!pColDefaults)
+return;
+sal_Int32 nPrevIndex;
+bool bPrevAutoStyle;
+OSL_ENSURE( static_castsize_t(nRow)  pRowDefaults-size(), nRow out of 
bounds);
+if (!(static_castsize_t(nRow)  pRowDefaults-size()))
+{
+/* This is only to prevent out-of-bounds accesses, once reached here
+ * there's something else going wrong, so FIXME there! */
+if (pRowDefaults-empty())
+{
+nPrevIndex = -1;
+bPrevAutoStyle = false;
+}
+else
+{
+nPrevIndex = (*pRowDefaults)[pRowDefaults-size()-1].nIndex;
+bPrevAutoStyle = 
(*pRowDefaults)[pRowDefaults-size()-1].bIsAutoStyle;
+}
+}
+else
+{
+nPrevIndex = (*pRowDefaults)[nRow].nIndex;
+bPrevAutoStyle = (*pRowDefaults)[nRow].bIsAutoStyle;
+}
 sal_uInt32 nEnd (rFormatRange.nRepeatRows + nRow - 1);
-sal_Int32 nPrevIndex((*pRowDefaults)[nRow].nIndex);
-bool bPrevAutoStyle((*pRowDefaults)[nRow].bIsAutoStyle);
 sal_uInt32 i(nRow + 1);
 bool bReady(false);
 while ((i  nEnd)  !bReady  (i  pRowDefaults-size()))
@@ -697,12 +722,34 @@ void ScRowFormatRanges::AddRange(ScMyRowFormatRange 
rFormatRange,
 rFormatRange.nRepeatRows = i - nRow + 1;
 if (nPrevIndex == -1)
 {
-nPrevIndex = (*pColDefaults)[rFormatRange.nStartColumn].nIndex;
-bPrevAutoStyle = 
(*pColDefaults)[rFormatRange.nStartColumn].bIsAutoStyle;
 sal_uInt32 nPrevStartCol(rFormatRange.nStartColumn);
-sal_uInt32 nRepeat((*pColDefaults)[rFormatRange.nStartColumn].nRepeat);
-nEnd = rFormatRange.nStartColumn + rFormatRange.nRepeatColumns;
-for(i = nPrevStartCol + nRepeat; i  nEnd; i += 
(*pColDefaults)[i].nRepeat)
+OSL_ENSURE( static_castsize_t(nPrevStartCol)  pColDefaults-size(), 
nPrevStartCol out of bounds);
+sal_uInt32 nRepeat;
+if (static_castsize_t(nPrevStartCol)  pColDefaults-size())
+{
+nRepeat = (*pColDefaults)[nPrevStartCol].nRepeat;
+nPrevIndex = (*pColDefaults)[nPrevStartCol].nIndex;
+bPrevAutoStyle = (*pColDefaults)[nPrevStartCol].bIsAutoStyle;
+}
+else
+{
+/* Again, this is to prevent out-of-bounds accesses, so FIXME
+ * elsewhere! */
+if (pColDefaults-empty())
+{
+nRepeat = 1;
+nPrevIndex = -1;
+bPrevAutoStyle = false;
+}
+else
+{
+nRepeat = (*pColDefaults)[pColDefaults-size()-1].nRepeat;
+nPrevIndex = (*pColDefaults)[pColDefaults-size()-1].nIndex;
+bPrevAutoStyle = 
(*pColDefaults)[pColDefaults-size()-1].bIsAutoStyle;
+}
+}
+nEnd = nPrevStartCol + rFormatRange.nRepeatColumns;
+for(i = nPrevStartCol + nRepeat; i  nEnd  i  pColDefaults-size(); 
i += (*pColDefaults)[i].nRepeat)
 {
 OSL_ENSURE(sal_uInt32(nPrevStartCol + nRepeat) = nEnd, something 
wents wrong);
 if ((nPrevIndex != (*pColDefaults)[i].nIndex) ||
@@ -923,6 +970,8 @@ sal_Int32 ScFormatRangeStyles::GetStyleNameIndex(const 
sal_Int32 nTable,
 const sal_Int32 nColumn, const sal_Int32 nRow, bool bIsAutoStyle) const
 {
 OSL_ENSURE(static_castsize_t(nTable)  aTables.size(), wrong table);
+if (!(static_castsize_t(nTable)  aTables.size()))
+return -1;
 ScMyFormatRangeAddresses* pFormatRanges(aTables[nTable]);
 ScMyFormatRangeAddresses::iterator aItr(pFormatRanges-begin());
 ScMyFormatRangeAddresses::iterator aEndItr(pFormatRanges-end());
@@ -946,6 +995,8 @@ sal_Int32 ScFormatRangeStyles::GetStyleNameIndex(const 
sal_Int32 nTable, const s
 bool bIsAutoStyle, sal_Int32 nValidationIndex, sal_Int32 nNumberFormat, 
const sal_Int32 nRemoveBeforeRow)
 {
 

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2011-12-15 Thread Eike Rathke
 sc/source/core/data/table3.cxx |   17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit cad074d663cc6034b73a485a151420287a38d7f9
Author: Eike Rathke er...@redhat.com
Date:   Thu Dec 15 21:23:09 2011 +0100

Resolved fdo#43831 Advanced FILTER incompatible with 3.4.4 documents

* Reintroduced logic in PrepareQueryItem::operator() that got lost during
  rework of ScQueryEntry.
  * ScQueryParamBase::FillInExcelSyntax() and the calling
lcl_createExcelQuery() create query entries always as ByString, that
needs to be converted to ByValue if appropriate.

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index b0d261f..e47d88e 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1683,15 +1683,26 @@ public:
 
 void operator() (ScQueryEntry::Item rItem)
 {
-// Double-check if the query by date is really appropriate.
-
-if (rItem.meType != ScQueryEntry::ByDate)
+if (rItem.meType != ScQueryEntry::ByString  rItem.meType != 
ScQueryEntry::ByDate)
 return;
 
 sal_uInt32 nIndex = 0;
 bool bNumber = mrDoc.GetFormatTable()-
 IsNumberFormat(rItem.maString, nIndex, rItem.mfVal);
 
+// Advanced Filter creates only ByString queries that need to be
+// converted to ByValue if appropriate. rItem.mfVal now holds the value
+// if bNumber==true.
+
+if (rItem.meType == ScQueryEntry::ByString)
+{
+if (bNumber)
+rItem.meType = ScQueryEntry::ByValue;
+return;
+}
+
+// Double-check if the query by date is really appropriate.
+
 if (bNumber  ((nIndex % SV_COUNTRY_LANGUAGE_OFFSET) != 0))
 {
 const SvNumberformat* pEntry = 
mrDoc.GetFormatTable()-GetEntry(nIndex);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2011-12-14 Thread Eike Rathke
 sc/source/ui/unoobj/chart2uno.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 08a5b8d650313d60e0e5e6abb15335495867cda5
Author: Eike Rathke er...@redhat.com
Date:   Wed Dec 14 19:59:32 2011 +0100

ShrinkRefTokenToDataRange:operator(): check if it's really ScDoubleRefToken

Resolved scary ScToken::GetDoubleRef: virtual dummy called debug message.

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 3852e3b..9aabfff 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1400,6 +1400,11 @@ public:
 if (ScRefTokenHelper::isExternalRef(rRef))
 return;
 
+// Don't assume an ScDoubleRefToken if it isn't. It can be at least an
+// ScSingleRefToken, then there isn't anything to shrink.
+if (rRef-GetType() != svDoubleRef)
+return;
+
 ScComplexRefData rData = rRef-GetDoubleRef();
 ScSingleRefData s = rData.Ref1;
 ScSingleRefData e = rData.Ref2;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2011-12-13 Thread Kohei Yoshida
 sc/source/ui/view/gridwin2.cxx |   14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit e23c5aa10619d69cfd7ea7222fc38019c411757a
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Tue Dec 13 22:01:36 2011 -0500

fdo#35981: Handle empty members correctly during field popup.

Or else filtering of field members will not work correctly when the
field contains an empty name.

diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index f2b10cf..7f2ce83 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -480,7 +480,12 @@ void ScGridWindow::DPLaunchFieldPopupMenu(
 for (size_t i = 0; i  n; ++i)
 {
 const ScDPLabelData::Member rMem = rLabelData.maMembers[i];
-mpDPFieldPopup-addMember(rMem.getDisplayName(), rMem.mbVisible);
+rtl::OUString aName = rMem.getDisplayName();
+if (aName.isEmpty())
+// Use special string for an empty name.
+
mpDPFieldPopup-addMember(ScGlobal::GetRscString(STR_EMPTYDATA), 
rMem.mbVisible);
+else
+mpDPFieldPopup-addMember(rMem.getDisplayName(), 
rMem.mbVisible);
 }
 mpDPFieldPopup-initMembers();
 }
@@ -581,9 +586,14 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu()
 if (itrNameMap == aMemNameMap.end())
 {
 // This is an original member name.  Use it as-is.
+rtl::OUString aName = itr-first;
+if (aName.equals(ScGlobal::GetRscString(STR_EMPTYDATA)))
+// Translate the special empty name into an empty string.
+aName = rtl::OUString();
+
 aResult.insert(
 ScCheckListMenuWindow::ResultType::value_type(
-itr-first, itr-second));
+aName, itr-second));
 }
 else
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2011-12-13 Thread Kohei Yoshida
 sc/source/filter/xml/XMLTableShapeImportHelper.cxx |2 +-
 sc/source/filter/xml/XMLTableShapeResizer.cxx  |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit df27ea1c4e8fb01add490593e923fbdf3211facc
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Wed Dec 14 00:31:34 2011 -0500

fdo#39118: Fixed chart listener registration during ODS import.

The breakage was due to the drawing layer re-work.  We do need to store
charts (or all OLE shapes with associated listening ranges) for later
registration regardless of anchor types.

diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx 
b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
index 7568b22..e2b1216 100644
--- a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
+++ b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
@@ -154,7 +154,7 @@ void XMLTableShapeImportHelper::finishShape(
 }
 }
 
-if ( bOnTable  pRangeList )
+if (pRangeList)
 {
 // #i78086# If there are notification ranges, the 
ChartListener must be created
 // also when anchored to the sheet
diff --git a/sc/source/filter/xml/XMLTableShapeResizer.cxx 
b/sc/source/filter/xml/XMLTableShapeResizer.cxx
index 9a53b78..2007b78 100644
--- a/sc/source/filter/xml/XMLTableShapeResizer.cxx
+++ b/sc/source/filter/xml/XMLTableShapeResizer.cxx
@@ -79,6 +79,7 @@ void ScMyOLEFixer::CreateChartListener(ScDocument* pDoc,
 }
 
 OUString aRangeStr;
+// This one returns ranges with ';' as the separators.
 ScRangeStringConverter::GetStringFromXMLRangeString(aRangeStr, rRangeList, 
pDoc);
 if (!aRangeStr.getLength())
 {
@@ -95,9 +96,8 @@ void ScMyOLEFixer::CreateChartListener(ScDocument* pDoc,
 SAL_WNODEPRECATED_DECLARATIONS_PUSH
 auto_ptr vectorScTokenRef  pRefTokens(new vectorScTokenRef);
 SAL_WNODEPRECATED_DECLARATIONS_POP
-const sal_Unicode cSep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
 ScRefTokenHelper::compileRangeRepresentation(
-*pRefTokens, aRangeStr, pDoc, cSep, 
formula::FormulaGrammar::GRAM_ENGLISH);
+*pRefTokens, aRangeStr, pDoc, ';', 
formula::FormulaGrammar::GRAM_ENGLISH);
 if (!pRefTokens-empty())
 {
 ScChartListener* pCL(new ScChartListener(rName, pDoc, 
pRefTokens.release()));
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2011-12-12 Thread Kohei Yoshida
 sc/source/ui/inc/output.hxx   |1 
 sc/source/ui/view/output2.cxx |   50 --
 2 files changed, 45 insertions(+), 6 deletions(-)

New commits:
commit 69efe76f07796323012d2c65e8c89996c77ea2d9
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Mon Dec 12 15:45:04 2011 -0500

fdo#32530: Correct default horizontal alignment for complex script.

diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
index 72934cf..9a81555 100644
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
@@ -102,6 +102,7 @@ private:
 longmnPosX;
 longmnPosY;
 longmnInitPosX;
+sal_uInt8   mnScript;
 boolmbBreak;
 boolmbCellIsValue;
 boolmbAsianVertical;
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index de1506a..82a9905 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1561,9 +1561,27 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
 bCellIsValue = pFCell-IsRunning() || 
pFCell-IsValue();
 }
 
-eOutHorJust = ( aVars.GetHorJust() != 
SVX_HOR_JUSTIFY_STANDARD ) ?
-  aVars.GetHorJust() :
-  ( bCellIsValue ? SVX_HOR_JUSTIFY_RIGHT : 
SVX_HOR_JUSTIFY_LEFT );
+if (aVars.GetHorJust() == SVX_HOR_JUSTIFY_STANDARD)
+{
+// fdo#32530: Default alignment depends on value vs
+// string, and the script type of the 1st letter.
+sal_uInt8 nScript1st = 0;
+rtl::OUString aStr = aVars.GetString();
+if (!aStr.isEmpty())
+{
+aStr = aStr.copy(0, 1);
+nScript1st = pDoc-GetStringScriptType(aStr);
+if (!nScript1st)
+nScript1st = ScGlobal::GetDefaultScriptType();
+}
+
+if (nScript1st == SCRIPTTYPE_COMPLEX)
+eOutHorJust = bCellIsValue ? SVX_HOR_JUSTIFY_LEFT 
: SVX_HOR_JUSTIFY_RIGHT;
+else
+eOutHorJust = bCellIsValue ? SVX_HOR_JUSTIFY_RIGHT 
: SVX_HOR_JUSTIFY_LEFT;
+}
+else
+eOutHorJust = aVars.GetHorJust();
 
 if ( eOutHorJust == SVX_HOR_JUSTIFY_BLOCK || eOutHorJust 
== SVX_HOR_JUSTIFY_REPEAT )
 eOutHorJust = SVX_HOR_JUSTIFY_LEFT; // repeat is 
not yet implemented
@@ -2137,6 +2155,7 @@ ScOutputData::DrawEditParam::DrawEditParam(const 
ScPatternAttr* pPattern, const
 mnArrY(0),
 mnX(0), mnY(0), mnCellX(0), mnCellY(0),
 mnPosX(0), mnPosY(0), mnInitPosX(0),
+mnScript(0),
 mbBreak( (meHorJust == SVX_HOR_JUSTIFY_BLOCK) || 
lcl_GetBoolValue(*pPattern, ATTR_LINEBREAK, pCondSet) ),
 mbCellIsValue(bCellIsValue),
 mbAsianVertical(false),
@@ -2567,9 +2586,16 @@ void ScOutputData::DrawEditStandard(DrawEditParam 
rParam)
 bHidden = true; // gedreht wird getrennt ausgegeben
 }
 
-SvxCellHorJustify eOutHorJust =
-( rParam.meHorJust != SVX_HOR_JUSTIFY_STANDARD ) ? rParam.meHorJust :
-( rParam.mbCellIsValue ? SVX_HOR_JUSTIFY_RIGHT : SVX_HOR_JUSTIFY_LEFT 
);
+SvxCellHorJustify eOutHorJust = rParam.meHorJust;
+if (eOutHorJust == SVX_HOR_JUSTIFY_STANDARD)
+{
+// fdo#32530: Default alignment depends on value vs string, and the
+// script type of the 1st letter.
+if (rParam.mnScript == SCRIPTTYPE_COMPLEX)
+eOutHorJust = rParam.mbCellIsValue ? SVX_HOR_JUSTIFY_LEFT : 
SVX_HOR_JUSTIFY_RIGHT;
+else
+eOutHorJust = rParam.mbCellIsValue ? SVX_HOR_JUSTIFY_RIGHT : 
SVX_HOR_JUSTIFY_LEFT;
+}
 
 if ( eOutHorJust == SVX_HOR_JUSTIFY_BLOCK || eOutHorJust == 
SVX_HOR_JUSTIFY_REPEAT )
 eOutHorJust = SVX_HOR_JUSTIFY_LEFT; // repeat is not yet 
implemented
@@ -4570,6 +4596,17 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
 else
 lcl_ClearEdit( *pEngine );  // also calls 
SetUpdateMode(sal_False)
 
+// fdo#32530: Get the script type of the first letter.
+sal_uInt8 nScript = 0;
+rtl::OUString aStr = pDoc-GetString(nCellX, nCellY, 
nTab);
+if (!aStr.isEmpty())
+{
+aStr = aStr.copy(0, 1);
+nScript = pDoc-GetStringScriptType(aStr);
+}
+if (nScript == 0)
+

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2011-12-10 Thread Eike Rathke
 sc/source/core/tool/interpr1.cxx |   41 +++
 1 file changed, 41 insertions(+)

New commits:
commit f7e552b202dc1d155f731e3da18737ea6c13e75f
Author: Eike Rathke er...@redhat.com
Date:   Sat Dec 10 20:29:06 2011 +0100

fixed fdo#43700 ROWS(), COLUMNS() and SHEETS() don't work with external 
references

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 862e92b..a76d2b6 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -4174,6 +4174,20 @@ void ScInterpreter::ScColumns()
 }
 }
 break;
+case svExternalSingleRef:
+PopError();
+nVal++;
+break;
+case svExternalDoubleRef:
+{
+sal_uInt16 nFileId;
+String aTabName;
+ScComplexRefData aRef;
+PopExternalDoubleRef( nFileId, aTabName, aRef);
+nVal += static_castsal_uLong(aRef.Ref2.nTab - aRef.Ref1.nTab 
+ 1) *
+static_castsal_uLong(aRef.Ref2.nCol - aRef.Ref1.nCol + 
1);
+}
+break;
 default:
 PopError();
 SetError(errIllegalParameter);
@@ -4218,6 +4232,20 @@ void ScInterpreter::ScRows()
 }
 }
 break;
+case svExternalSingleRef:
+PopError();
+nVal++;
+break;
+case svExternalDoubleRef:
+{
+sal_uInt16 nFileId;
+String aTabName;
+ScComplexRefData aRef;
+PopExternalDoubleRef( nFileId, aTabName, aRef);
+nVal += static_castsal_uLong(aRef.Ref2.nTab - aRef.Ref1.nTab 
+ 1) *
+static_castsal_uLong(aRef.Ref2.nRow - aRef.Ref1.nRow + 
1);
+}
+break;
 default:
 PopError();
 SetError(errIllegalParameter);
@@ -4258,6 +4286,19 @@ void ScInterpreter::ScTables()
 PopError();
 nVal++;
 break;
+case svExternalSingleRef:
+PopError();
+nVal++;
+break;
+case svExternalDoubleRef:
+{
+sal_uInt16 nFileId;
+String aTabName;
+ScComplexRefData aRef;
+PopExternalDoubleRef( nFileId, aTabName, aRef);
+nVal += static_castsal_uLong(aRef.Ref2.nTab - 
aRef.Ref1.nTab + 1);
+}
+break;
 default:
 PopError();
 SetError( errIllegalParameter );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source svx/inc svx/source

2011-12-09 Thread Kohei Yoshida
 sc/source/ui/view/drawvie3.cxx |7 +++
 svx/inc/svx/svdhdl.hxx |1 +
 svx/source/svdraw/svdhdl.cxx   |   20 
 3 files changed, 28 insertions(+)

New commits:
commit 656b578086f88f262002869c3632fdbd95a66784
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Fri Dec 9 16:31:30 2011 -0500

fdo#38545: Show/hide anchor when the anchoring status changes.

Setting a page-anchored object to cell-anchored didn't show the anchor
immediately until you unselect the object and re-select it.  Same for
the cell-anchored to page-anchored direction.

This commit fixes it.

diff --git a/sc/source/ui/view/drawvie3.cxx b/sc/source/ui/view/drawvie3.cxx
index 964fb14..ed701a2 100644
--- a/sc/source/ui/view/drawvie3.cxx
+++ b/sc/source/ui/view/drawvie3.cxx
@@ -87,6 +87,10 @@ void ScDrawView::SetPageAnchored()
 
 if ( pViewData )
 pViewData-GetDocShell()-SetDrawModified();
+
+// Remove the anchor object.
+aHdl.RemoveAllByKind(HDL_ANCHOR);
+aHdl.RemoveAllByKind(HDL_ANCHOR_TR);
 }
 }
 
@@ -108,6 +112,9 @@ void ScDrawView::SetCellAnchored()
 
 if ( pViewData )
 pViewData-GetDocShell()-SetDrawModified();
+
+// Set the anchor object.
+AddCustomHdl();
 }
 }
 
diff --git a/svx/inc/svx/svdhdl.hxx b/svx/inc/svx/svdhdl.hxx
index 895644d..f94a00e 100644
--- a/svx/inc/svx/svdhdl.hxx
+++ b/svx/inc/svx/svdhdl.hxx
@@ -502,6 +502,7 @@ public:
 // also auf dem Heap stehen, da Clear() ein delete macht.
 voidAddHdl(SdrHdl* pHdl, sal_Bool bAtBegin=sal_False);
 SdrHdl* RemoveHdl(sal_uIntPtr nNum);
+void RemoveAllByKind(SdrHdlKind eKind);
 
 // Zuletzt eingefuegte Handles werden am ehesten getroffen
 // (wenn Handles uebereinander liegen).
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 3d2e786..5d58e1f 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -2081,6 +2081,26 @@ SdrHdl* SdrHdlList::RemoveHdl(sal_uIntPtr nNum)
 return pRetval;
 }
 
+void SdrHdlList::RemoveAllByKind(SdrHdlKind eKind)
+{
+SdrHdl* p = static_castSdrHdl*(aList.Last());
+while (p)
+{
+if (p-GetKind() == eKind)
+{
+// If removing an item doesn't invalidate the current position,
+// then perhaps it's safe to keep calling Prev here.  But then I'm
+// too lazy to find out  this Container needs to be replaced by
+// STL anyways... :-P
+aList.Remove(p);
+delete p;
+p = static_castSdrHdl*(aList.Last()); // start from the back 
again.
+}
+else
+p = static_castSdrHdl*(aList.Prev());
+}
+}
+
 void SdrHdlList::Clear()
 {
 for (sal_uIntPtr i=0; iGetHdlCount(); i++)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2011-12-09 Thread Kohei Yoshida
 sc/source/ui/unoobj/chart2uno.cxx |  105 +-
 1 file changed, 60 insertions(+), 45 deletions(-)

New commits:
commit 3d5e50860ea9375acad9c42f2aefbbf6d7a1866e
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Sat Dec 10 00:41:09 2011 -0500

fdo#43467: Infer number format from formula result if appropriate.

In case the data source has a formula cell, the number format may be
inferred from the formula result in case the cell format is General.

Also,

1) no need to use UNO API in the API implementation.  Let use the
   internal API here.

2) this method didn't take into account the hidden cells.

TODO: We need to handle number formats for external ref data properly.

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 1847bb0..3852e3b 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -3145,80 +3145,95 @@ uno::Sequence ::rtl::OUString  SAL_CALL 
ScChart2DataSequence::generateLabel(ch
 return aSeq;
 }
 
+namespace {
+
+sal_uLong getDisplayNumberFormat(ScDocument* pDoc, const ScAddress rPos)
+{
+sal_uLong nFormat = pDoc-GetNumberFormat(rPos); // original format from 
cell.
+SvNumberFormatter* pFormatter = pDoc-GetFormatTable();
+if (!pFormatter)
+return nFormat;
+
+ScBaseCell* pCell = pDoc-GetCell(rPos);
+if (!pCell || pCell-GetCellType() != CELLTYPE_FORMULA)
+return nFormat;
+
+// With formula cell, the format may be inferred from the formula result.
+return static_castScFormulaCell*(pCell)-GetStandardFormat(*pFormatter, 
nFormat);
+}
+
+}
+
 ::sal_Int32 SAL_CALL ScChart2DataSequence::getNumberFormatKeyByIndex( 
::sal_Int32 nIndex )
 throw (lang::IndexOutOfBoundsException,
uno::RuntimeException)
 {
 // index -1 means a heuristic value for the entire sequence
 bool bGetSeriesFormat = (nIndex == -1);
-sal_Int32 nResult = 0;
 
 SolarMutexGuard aGuard;
 if ( !m_pDocument || !m_pTokens.get())
-return nResult;
-
-sal_Int32 nCount = 0;
-bool bFound = false;
-ScRange* p;
+return 0;
 
-uno::Reference sheet::XSpreadsheetDocument xSpreadDoc( 
lcl_GetSpreadSheetDocument( m_pDocument ));
-if (!xSpreadDoc.is())
-return nResult;
+// TODO: Handle external references too.
 
-uno::Referencecontainer::XIndexAccess xIndex( xSpreadDoc-getSheets(), 
uno::UNO_QUERY );
-if (!xIndex.is())
-return nResult;
+sal_Int32 nCount = 0;
 
 ScRangeList aRanges;
 ScRefTokenHelper::getRangeListFromTokens(aRanges, *m_pTokens);
-uno::Reference table::XCellRange  xSheet;
-for ( size_t rIndex = 0, nRanges = aRanges.size(); (rIndex  nRanges)  
!bFound; ++rIndex )
-{
-p = aRanges[ rIndex ];
-// TODO: use DocIter?
-table::CellAddress aStart, aEnd;
-ScUnoConversion::FillApiAddress( aStart, p-aStart );
-ScUnoConversion::FillApiAddress( aEnd, p-aEnd );
-for ( sal_Int16 nSheet = aStart.Sheet; nSheet = aEnd.Sheet  
!bFound; ++nSheet)
-{
-xSheet.set(xIndex-getByIndex(nSheet), uno::UNO_QUERY);
-for ( sal_Int32 nCol = aStart.Column; nCol = aEnd.Column  
!bFound; ++nCol)
+for (size_t i = 0, n = aRanges.size(); i  n; ++i)
+{
+ScRange* p = aRanges[i];
+for (SCTAB nTab = p-aStart.Tab(); nTab = p-aEnd.Tab(); ++nTab)
+{
+for (SCCOL nCol = p-aStart.Col(); nCol = p-aEnd.Col(); ++nCol)
 {
-for ( sal_Int32 nRow = aStart.Row; nRow = aEnd.Row  
!bFound; ++nRow)
+if (!m_bIncludeHiddenCells)
 {
+// Skip hidden columns.
+SCCOL nLastCol = -1;
+bool bColHidden = m_pDocument-ColHidden(nCol, nTab, NULL, 
nLastCol);
+if (bColHidden)
+{
+nCol = nLastCol;
+continue;
+}
+}
+
+for (SCROW nRow = p-aStart.Row(); nRow = p-aEnd.Row(); 
++nRow)
+{
+if (!m_bIncludeHiddenCells)
+{
+// Skip hidden rows.
+SCROW nLastRow = -1;
+bool bRowHidden = m_pDocument-RowHidden(nRow, nTab, 
NULL, nLastRow);
+if (bRowHidden)
+{
+nRow = nLastRow;
+continue;
+}
+}
+
+ScAddress aPos(nCol, nRow, nTab);
+
 if( bGetSeriesFormat )
 {
 // TODO: use nicer heuristic
 // return format of first non-empty cell
-uno::Reference text::XText  xText(
-xSheet-getCellByPosition(nCol, 

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2011-12-08 Thread Michael Meeks
 sc/source/ui/src/namedefdlg.src |2 +-
 sc/source/ui/src/namedlg.src|2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2357cd3e95b46fb74e364cfd25f59fd5524d0c95
Author: Olivier Hallot olivier.hal...@alta.org.br
Date:   Wed Dec 7 15:56:17 2011 -0200

Fix for bug fdo43586, need more room for localized string

This patch fixzex bug fdo43586, more room needed for localized strings in 
named range dialog.

diff --git a/sc/source/ui/src/namedefdlg.src b/sc/source/ui/src/namedefdlg.src
index 1a19f0b..42538dd 100644
--- a/sc/source/ui/src/namedefdlg.src
+++ b/sc/source/ui/src/namedefdlg.src
@@ -55,7 +55,7 @@ ModelessDialog RID_SCDLG_NAMES_DEFINE
 CheckBox BTN_MORE
 {
 Pos = MAP_APPFONT( 5, 82 );
-Size = MAP_APPFONT( 60, 15 );
+Size = MAP_APPFONT( 80, 15 );
 Text [en-US] = Range Options;
 };
 FixedText FT_INFO
diff --git a/sc/source/ui/src/namedlg.src b/sc/source/ui/src/namedlg.src
index 3e2eb42..6c1c46a 100644
--- a/sc/source/ui/src/namedlg.src
+++ b/sc/source/ui/src/namedlg.src
@@ -128,7 +128,7 @@ ModelessDialog RID_SCDLG_NAMES
 {
 HelpID = sc:MoreButton:RID_SCDLG_NAMES:BTN_MORE;
 Pos = MAP_APPFONT ( 5 , 185 ) ;
-Size = MAP_APPFONT ( 50 , 15 ) ;
+Size = MAP_APPFONT ( 80 , 15 ) ;
 Text [en-US] = Range Options;
 };
 FixedLine FL_DIV
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2011-12-08 Thread Eike Rathke
 sc/source/ui/app/inputwin.cxx |   32 +---
 sc/source/ui/inc/inputwin.hxx |3 +++
 2 files changed, 32 insertions(+), 3 deletions(-)

New commits:
commit df28789d46d7f82b02502484e1fb105738cdf695
Author: Eike Rathke er...@redhat.com
Date:   Fri Dec 9 00:27:17 2011 +0100

fixed fdo#43614 Crash when closing document and several Spreadsheet 
documents open

During Paint() in ScMultiTextWnd::InitEditEngine(),
ScTabViewShell::GetActiveViewShell() may return a view shell that does not
correspond with the document to be repainted if another document was opened 
or
when switching between documents. Prevent creating an EditEngine with wrong
SfxItemPool.

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index a271487..83bdb8a 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1094,11 +1094,19 @@ IMPL_LINK( ScInputBarGroup, Impl_ScrollHdl, ScrollBar*, 
EMPTYARG )
 //  ScMultiTextWnd
 //
 
-ScMultiTextWnd::ScMultiTextWnd( ScInputBarGroup* pParen ) : ScTextWnd( 
pParen/*, WB_TABSTOP*/ ), mrGroupBar(* pParen )
+ScMultiTextWnd::ScMultiTextWnd( ScInputBarGroup* pParen )
+:
+ScTextWnd( pParen/*, WB_TABSTOP*/ ),
+mrGroupBar(* pParen ),
+mpAssignedDocument( NULL ),
+mnLines( 1 ),
+mnLastExpandedLines( INPUTWIN_MULTILINES )
 {
 nTextStartPos = TEXT_MULTI_STARTPOS;
-mnLines = 1;
-mnLastExpandedLines = INPUTWIN_MULTILINES;
+}
+
+ScMultiTextWnd::~ScMultiTextWnd()
+{
 }
 
 int ScMultiTextWnd::GetLineCount()
@@ -1290,6 +1298,24 @@ void ScMultiTextWnd::InitEditEngine(SfxObjectShell* 
pObjSh)
 if ( pViewSh )
 {
 const ScDocument* pDoc = pViewSh-GetViewData()-GetDocument();
+
+// fdo#43614 If called from Paint() because pEditEngine==0 it may be
+// that StopEditEngine() was previously called when opening another
+// document or switching documents, the Paint() wants to paint the
+// previous document, but GetActiveViewShell() already returns the
+// shell of the new document. In that case we'd create an EditEngine
+// with the wrong item pool that later crashes when the corresponding
+// document was closed and may lead to other sorts of trouble.
+
+if (mpAssignedDocument)
+{
+if (mpAssignedDocument != pDoc)
+return; // Bail out, don't create and remember an
+// EditEngine without document pools for this case.
+}
+else
+mpAssignedDocument = pDoc;  // stick with this document
+
 pNew = new ScFieldEditEngine( pDoc-GetEnginePool(), 
pDoc-GetEditPool() );
 }
 else
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index 7a1da05..c0f4234 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -46,6 +46,7 @@ class ScInputHandler;
 class ScAccessibleEditLineTextData;
 struct EENotify;
 class ScRangeList;
+class ScDocument;
 
 //
 
@@ -172,6 +173,7 @@ class ScMultiTextWnd : public ScTextWnd
 {
 public:
 ScMultiTextWnd( ScInputBarGroup* pParent );
+virtual ~ScMultiTextWnd();
 virtual void StartEditEngine();
 virtual void StopEditEngine( sal_Bool bAll );
 int GetLineCount();
@@ -194,6 +196,7 @@ protected:
 private:
 long GetPixelTextHeight();
 ScInputBarGroup mrGroupBar;
+const ScDocument* mpAssignedDocument;
 long mnLines;
 long mnLastExpandedLines;
 };
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2011-12-08 Thread Kohei Yoshida
 sc/source/core/tool/rangeutl.cxx |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 38e698d6913b11055144ebee6fb21c30566e0c3b
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Thu Dec 8 21:37:10 2011 -0500

bnc#727504: Correctly convert chart data ranges.

We were supported to convert XML chart data range representations
with a hard-coded ';' as the range union operators, but incorrectly
using UI configurable range separators.  This caused charts with
series that consisted of multiple ranges to be imported correctly in
locales where the range separator (which re-uses the function argument
separator) was something other than ';'.

BTW I plan to remove this always use Calc A1 syntax restriction in
future versions.

diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx
index fda7615..5e1db5d 100644
--- a/sc/source/core/tool/rangeutl.cxx
+++ b/sc/source/core/tool/rangeutl.cxx
@@ -898,8 +898,7 @@ static void lcl_appendCellRangeAddress(
 void ScRangeStringConverter::GetStringFromXMLRangeString( OUString rString, 
const OUString rXMLRange, ScDocument* pDoc )
 {
 FormulaGrammar::AddressConvention eConv = pDoc-GetAddressConvention();
-const OUString aRangeSep = ScCompiler::GetNativeSymbol(ocSep);
-const sal_Unicode cSep = ' ';
+const sal_Unicode cSep = ' ', cSepNew = ';';
 const sal_Unicode cQuote = '\'';
 
 OUStringBuffer aRetStr;
@@ -984,7 +983,7 @@ void ScRangeStringConverter::GetStringFromXMLRangeString( 
OUString rString, con
 if (bFirst)
 bFirst = false;
 else
-aRetStr.append(aRangeSep);
+aRetStr.append(cSepNew);
 
 lcl_appendCellRangeAddress(aRetStr, pDoc, aCell1, aCell2, 
aExtInfo1, aExtInfo2);
 }
@@ -1006,7 +1005,7 @@ void ScRangeStringConverter::GetStringFromXMLRangeString( 
OUString rString, con
 if (bFirst)
 bFirst = false;
 else
-aRetStr.append(aRangeSep);
+aRetStr.append(cSepNew);
 
 lcl_appendCellAddress(aRetStr, pDoc, aCell, aExtInfo);
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2011-12-08 Thread Kohei Yoshida
 sc/source/core/data/column3.cxx |   46 ++--
 sc/source/core/data/table3.cxx  |7 +-
 2 files changed, 36 insertions(+), 17 deletions(-)

New commits:
commit 27b8382d07b8b0edafd6665906b59bc1cca9dcfe
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Thu Dec 8 23:02:26 2011 -0500

bnc#656073: Allow filtering by error value.

The old way was that an error cell was evaulated as having a value of 0.
The error cell also showed up as blank in the popup.  Using the error
string is much more intuitive (and some users apparently want this
behavior).

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 898edfd..fbeb951 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1575,9 +1575,9 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW 
nEndRow, TypedScStrCollec
 
 while ( (nIndex  nCount) ? ((nRow=pItems[nIndex].nRow) = nEndRow) : 
false )
 {
-ScBaseCell*  pCell= pItems[nIndex].pCell;
-TypedStrData*pData;
-sal_uLongnFormat  = GetNumberFormat( nRow );
+ScBaseCell* pCell = pItems[nIndex].pCell;
+TypedStrData* pData = NULL;
+sal_uLong nFormat = GetNumberFormat( nRow );
 
 ScCellFormat::GetInputString( pCell, nFormat, aString, *pFormatter );
 
@@ -1585,7 +1585,7 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW 
nEndRow, TypedScStrCollec
 pData = new TypedStrData( aString );
 else
 {
-double nValue;
+double nValue = 0.0;
 
 switch ( pCell-GetCellType() )
 {
@@ -1594,26 +1594,40 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW 
nEndRow, TypedScStrCollec
 break;
 
 case CELLTYPE_FORMULA:
-nValue = ((ScFormulaCell*)pCell)-GetValue();
-break;
+{
+ScFormulaCell* pFC = static_castScFormulaCell*(pCell);
+sal_uInt16 nErr = pFC-GetErrCode();
+if (nErr)
+{
+// Error cell is evaluated as string (for now).
+String aErr = ScGlobal::GetErrorString(nErr);
+if (aErr.Len())
+pData = new TypedStrData(aErr);
+}
+else
+nValue = pFC-GetValue();
+}
+break;
 
 default:
-nValue = 0.0;
+;
 }
 
-if (pFormatter)
+if (!pData)
 {
-short nType = pFormatter-GetType(nFormat);
-if ((nType  NUMBERFORMAT_DATE)  !(nType  
NUMBERFORMAT_TIME))
+if (pFormatter)
 {
-// special case for date values.  Disregard the time
-// element if the number format is of date type.
-nValue = ::rtl::math::approxFloor(nValue);
-bHasDates = true;
+short nType = pFormatter-GetType(nFormat);
+if ((nType  NUMBERFORMAT_DATE)  !(nType  
NUMBERFORMAT_TIME))
+{
+// special case for date values.  Disregard the time
+// element if the number format is of date type.
+nValue = ::rtl::math::approxFloor(nValue);
+bHasDates = true;
+}
 }
+pData = new TypedStrData( aString, nValue, SC_STRTYPE_VALUE );
 }
-
-pData = new TypedStrData( aString, nValue, SC_STRTYPE_VALUE );
 }
 
 if ( !rStrings.Insert( pData ) )
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 1be106f..ffd5d6f 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1277,7 +1277,12 @@ public:
 
 if ( pCell )
 {
-if (pCell-GetCellType() != CELLTYPE_NOTE)
+if (pCell-GetCellType() == CELLTYPE_FORMULA  
pCell-GetErrorCode())
+{
+// Error cell is evaluated as string (for now).
+aCellStr = ScGlobal::GetErrorString(pCell-GetErrorCode());
+}
+else if (pCell-GetCellType() != CELLTYPE_NOTE)
 {
 sal_uLong nFormat = mrTab.GetNumberFormat( 
static_castSCCOL(rEntry.nField), nRow );
 ScCellFormat::GetInputString(pCell, nFormat, aCellStr, 
*mrDoc.GetFormatTable());
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2011-12-07 Thread Kohei Yoshida
 sc/source/filter/xml/xmlsubti.cxx |   72 +++---
 1 file changed, 44 insertions(+), 28 deletions(-)

New commits:
commit 821c45defbb86f7dcb981eeb375beb2b7affe601
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Wed Dec 7 23:53:56 2011 -0500

We need to set the current cell range object regardless of style name.

Otherwise we would fail to import the cell contents of those documents
that don't include table styles at all.  Some hand-crafted ods documents
don't provide table styles, which 3.4 imported just fine.

diff --git a/sc/source/filter/xml/xmlsubti.cxx 
b/sc/source/filter/xml/xmlsubti.cxx
index 004fadb..32684b7 100644
--- a/sc/source/filter/xml/xmlsubti.cxx
+++ b/sc/source/filter/xml/xmlsubti.cxx
@@ -170,6 +170,29 @@ ScMyTables::~ScMyTables()
 {
 }
 
+namespace {
+
+uno::Referencesheet::XSpreadsheet getCurrentSheet(const 
uno::Referenceframe::XModel xModel, SCTAB nSheet)
+{
+uno::Referencesheet::XSpreadsheet xSheet;
+uno::Referencesheet::XSpreadsheetDocument xSpreadDoc(xModel, 
uno::UNO_QUERY);
+if (!xSpreadDoc.is())
+return xSheet;
+
+uno::Reference sheet::XSpreadsheets xSheets(xSpreadDoc-getSheets());
+if (!xSheets.is())
+return xSheet;
+
+uno::Reference container::XIndexAccess xIndex(xSheets, uno::UNO_QUERY);
+if (!xIndex.is())
+return xSheet;
+
+xSheet.set(xIndex-getByIndex(nSheet), uno::UNO_QUERY);
+return xSheet;
+}
+
+}
+
 void ScMyTables::NewSheet(const rtl::OUString sTableName, const 
rtl::OUString sStyleName,
   const ScXMLTabProtectionData rProtectData)
 {
@@ -192,7 +215,14 @@ void ScMyTables::NewSheet(const rtl::OUString sTableName, 
const rtl::OUString
 pDoc-SetTabNameOnLoad(nCurrentSheet, sTableName);
 
 rImport.SetTableStyle(sStyleName);
-SetTableStyle(sStyleName);
+xCurrentSheet = getCurrentSheet(rImport.GetModel(), nCurrentSheet);
+if (xCurrentSheet.is())
+{
+// We need to set the current cell range here regardless of
+// presence of style name.
+xCurrentCellRange.set(xCurrentSheet, uno::UNO_QUERY);
+SetTableStyle(sStyleName);
+}
 }
 
 NewTable(1);
@@ -212,37 +242,23 @@ void ScMyTables::SetTableStyle(const rtl::OUString 
sStyleName)
 // RTL layout is only remembered, not actually applied, so the shapes 
can
 // be loaded before mirroring.
 
-uno::Reference sheet::XSpreadsheetDocument xSpreadDoc( 
rImport.GetModel(), uno::UNO_QUERY );
-
-if ( xSpreadDoc.is() )
+if ( xCurrentSheet.is() )
 {
-uno::Reference sheet::XSpreadsheets 
xSheets(xSpreadDoc-getSheets());
-if ( xSheets.is() )
+xCurrentCellRange.set(xCurrentSheet, uno::UNO_QUERY);
+uno::Reference beans::XPropertySet xProperties(xCurrentSheet, 
uno::UNO_QUERY);
+if ( xProperties.is() )
 {
-uno::Reference container::XIndexAccess xIndex( xSheets, 
uno::UNO_QUERY );
-if ( xIndex.is() )
+XMLTableStylesContext *pStyles = (XMLTableStylesContext 
*)rImport.GetAutoStyles();
+if ( pStyles )
 {
-xCurrentSheet.set(xIndex-getByIndex(nCurrentSheet), 
uno::UNO_QUERY);
-if ( xCurrentSheet.is() )
+XMLTableStyleContext* pStyle = (XMLTableStyleContext 
*)pStyles-FindStyleChildContext(
+XML_STYLE_FAMILY_TABLE_TABLE, sStyleName, true);
+if ( pStyle )
 {
-xCurrentCellRange.set(xCurrentSheet, uno::UNO_QUERY);
-uno::Reference beans::XPropertySet 
xProperties(xCurrentSheet, uno::UNO_QUERY);
-if ( xProperties.is() )
-{
-XMLTableStylesContext *pStyles = 
(XMLTableStylesContext *)rImport.GetAutoStyles();
-if ( pStyles )
-{
-XMLTableStyleContext* pStyle = 
(XMLTableStyleContext *)pStyles-FindStyleChildContext(
-XML_STYLE_FAMILY_TABLE_TABLE, 
sStyleName, true);
-if ( pStyle )
-{
-pStyle-FillPropertySet(xProperties);
-
-ScSheetSaveData* pSheetData = 
ScModelObj::getImplementation(rImport.GetModel())-GetSheetSaveData();
-pSheetData-AddTableStyle( sStyleName, 
ScAddress( 0, 0, nCurrentSheet ) );
-}
-}
-}
+pStyle-FillPropertySet(xProperties);
+
+ScSheetSaveData* pSheetData = 
ScModelObj::getImplementation(rImport.GetModel())-GetSheetSaveData();
+