[ooo-build-commit] .: 3 commits - patches/dev300
Kohei Yoshida
kohei at kemper.freedesktop.org
Thu May 20 19:55:13 PDT 2010
patches/dev300/apply | 34
patches/dev300/boost-1.39-extra-header.diff | 61
patches/dev300/boost-deliver-ptr-container.diff | 68
patches/dev300/calc-autodecimal-ods-fix.diff | 53
patches/dev300/calc-filter-dbf-precision.diff | 14
patches/dev300/calc-find-replace-skip-filtered-sfx2.diff | 119
patches/dev300/calc-find-replace-skip-filtered-svl.diff | 146 +
patches/dev300/calc-general-type-auto-decimal-disable-linebreak.diff | 119
patches/dev300/calc-general-type-auto-decimal-ieee754-fix.diff | 45
patches/dev300/calc-general-type-auto-decimal-officecfg.diff | 25
patches/dev300/calc-general-type-auto-decimal-printer-matrix-fix.diff | 80
patches/dev300/calc-general-type-auto-decimal-sc-dbf-fix.diff | 143
patches/dev300/calc-general-type-auto-decimal-sc.diff | 1186 --------
patches/dev300/calc-general-type-auto-decimal-svtools.diff | 452 ---
patches/dev300/cws-koheiautodecimal-boost.diff | 345 ++
patches/dev300/cws-koheiautodecimal-sc.diff | 1455 ++++++++++
patches/dev300/cws-koheiautodecimal-svl.diff | 414 ++
patches/dev300/cws-koheiautodecimal-testautomation.diff | 66
18 files changed, 2443 insertions(+), 2382 deletions(-)
New commits:
commit 57f210f61b702289933ebf9677a3683d9d199899
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Thu May 20 22:53:40 2010 -0400
Adjusted or removed patches.
* patches/dev300/apply:
* patches/dev300/boost-1.39-extra-header.diff: I believe this patch
was actually not needed. Removed.
* patches/dev300/calc-autodecimal-ods-fix.diff:
* patches/dev300/boost-deliver-ptr-container.diff: incorporated into
koheiautodecimal cws. Removed.
* patches/dev300/calc-filter-dbf-precision.diff: adjusted to apply.
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 04e0762..5f7c2d9 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3277,11 +3277,6 @@ svx-ppt-import-fix-bullet-size.diff, n#515972, rodo
# correctly import connector style attribute.
svx-msdff-import-connector-style-fix.diff, n#559393, i#108086, kohei
-[ Fixes ]
-# deliver extra headers for svg import filter.
-boost-1.39-extra-header.diff, kohei
-boost-deliver-ptr-container.diff, kohei
-
[ Win32Only ]
# FIXME dev300-m77: Doesn't apply, maybe not needed
# win32-boost-crack.diff
@@ -3611,9 +3606,6 @@ calc-formula-r1c1-ui-fix.diff, n#595078, n#595080, kohei
# Fix handling of DB functions.
calc-formula-db-function-fix.diff, n#594332, n#595713, kohei
-# Avoid exporting negative decimal places in ods format.
-calc-autodecimal-ods-fix.diff, i#110634, kohei
-
# Trim empty cells at the bottom of columns.
calc-extref-trim-empty-cells.diff, n#600667, i#110595, kohei
diff --git a/patches/dev300/boost-1.39-extra-header.diff b/patches/dev300/boost-1.39-extra-header.diff
deleted file mode 100644
index 640f48f..0000000
--- a/patches/dev300/boost-1.39-extra-header.diff
+++ /dev/null
@@ -1,61 +0,0 @@
-From be057ca8b061b016fe875c72483a1de7d8593bfe Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 17:06:58 +0200
-Subject: [PATCH 647/768] boost-1.39-extra-header.diff
-
----
- boost/prj/d.lst | 17 +++++++++++++++++
- 1 files changed, 17 insertions(+), 0 deletions(-)
-
-diff --git boost/prj/d.lst boost/prj/d.lst
-index 07d5a72..cef2abc 100644
---- boost/prj/d.lst
-+++ boost/prj/d.lst
-@@ -1,5 +1,7 @@
- mkdir: %_DEST%\inc%_EXT%\boost
- mkdir: %_DEST%\inc%_EXT%\boost\bind
-+mkdir: %_DEST%\inc%_EXT%\boost\concept
-+mkdir: %_DEST%\inc%_EXT%\boost\concept\detail
- mkdir: %_DEST%\inc%_EXT%\boost\config
- mkdir: %_DEST%\inc%_EXT%\boost\config\compiler
- mkdir: %_DEST%\inc%_EXT%\boost\config\no_tr1
-@@ -106,6 +108,7 @@ mkdir: %_DEST%\inc%_EXT%\boost\spirit\home
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\actor
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\actor\impl
-+mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\attribute
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\debug
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\debug\impl
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\meta
-@@ -120,10 +123,15 @@ mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\core\primitives
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\core\primitives\impl
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\core\composite
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\core\composite\impl
-+mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\dynamic
-+mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\dynamic\impl
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\error_handling
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\error_handling\impl
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\iterator
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\iterator\impl
-+mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\phoenix
-+mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\symbols
-+mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\symbols\impl
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\utility
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\utility\impl
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\utility\impl\chset
-@@ -300,3 +308,12 @@ mkdir: %_DEST%\inc%_EXT%\boost\variant\detail
- ..\%__SRC%\inc\boost\utility\* %_DEST%\inc%_EXT%\boost\utility
- ..\%__SRC%\inc\boost\variant\* %_DEST%\inc%_EXT%\boost\variant
- ..\%__SRC%\inc\boost\variant\detail\* %_DEST%\inc%_EXT%\boost\variant\detail
-+..\%__SRC%\misc\build\boost_1_39_0\boost\concept\* %_DEST%\inc%_EXT%\boost\concept
-+..\%__SRC%\misc\build\boost_1_39_0\boost\concept\detail\* %_DEST%\inc%_EXT%\boost\concept\detail
-+..\%__SRC%\misc\build\boost_1_39_0\boost\spirit\home\classic\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\
-+..\%__SRC%\misc\build\boost_1_39_0\boost\spirit\home\classic\attribute\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\attribute
-+..\%__SRC%\misc\build\boost_1_39_0\boost\spirit\home\classic\dynamic\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\dynamic
-+..\%__SRC%\misc\build\boost_1_39_0\boost\spirit\home\classic\dynamic\impl\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\dynamic\impl
-+..\%__SRC%\misc\build\boost_1_39_0\boost\spirit\home\classic\phoenix\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\phoenix
-+..\%__SRC%\misc\build\boost_1_39_0\boost\spirit\home\classic\symbols\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\symbols
-+..\%__SRC%\misc\build\boost_1_39_0\boost\spirit\home\classic\symbols\impl\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\symbols\impl
---
-1.7.0.1
-
diff --git a/patches/dev300/boost-deliver-ptr-container.diff b/patches/dev300/boost-deliver-ptr-container.diff
deleted file mode 100755
index d4b266f..0000000
--- a/patches/dev300/boost-deliver-ptr-container.diff
+++ /dev/null
@@ -1,68 +0,0 @@
-From 7bf1a71d2f46ea68c90968e7a965ecd3b352f6d7 Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 17:06:59 +0200
-Subject: [PATCH 648/768] boost-deliver-ptr-container.diff
-
----
- boost/makefile.mk | 2 ++
- boost/prj/d.lst | 10 ++++++++++
- 2 files changed, 12 insertions(+), 0 deletions(-)
-
-diff --git boost/makefile.mk boost/makefile.mk
-index 8c1df4e..fdc1dfd 100644
---- boost/makefile.mk
-+++ boost/makefile.mk
-@@ -91,6 +91,8 @@ $(PACKAGE_DIR)$/$(NORMALIZE_FLAG_FILE) : $(PACKAGE_DIR)$/$(BUILD_FLAG_FILE)
- @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(TARFILE_NAME)$/boost$/pending $(INCCOM)$/$(PRJNAME)
- @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(TARFILE_NAME)$/boost$/pool $(INCCOM)$/$(PRJNAME)
- @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(TARFILE_NAME)$/boost$/preprocessor $(INCCOM)$/$(PRJNAME)
-+ @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(TARFILE_NAME)$/boost$/ptr_container $(INCCOM)$/$(PRJNAME)
-+ @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(TARFILE_NAME)$/boost$/range $(INCCOM)$/$(PRJNAME)
- @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(TARFILE_NAME)$/boost$/spirit $(INCCOM)$/$(PRJNAME)
- @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(TARFILE_NAME)$/boost$/smart_ptr $(INCCOM)$/$(PRJNAME)
- @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(TARFILE_NAME)$/boost$/tuple $(INCCOM)$/$(PRJNAME)
-diff --git boost/prj/d.lst boost/prj/d.lst
-index cef2abc..f6b97b2 100644
---- boost/prj/d.lst
-+++ boost/prj/d.lst
-@@ -83,6 +83,10 @@ mkdir: %_DEST%\inc%_EXT%\boost\preprocessor\seq\detail
- mkdir: %_DEST%\inc%_EXT%\boost\preprocessor\slot
- mkdir: %_DEST%\inc%_EXT%\boost\preprocessor\slot\detail
- mkdir: %_DEST%\inc%_EXT%\boost\preprocessor\tuple
-+mkdir: %_DEST%\inc%_EXT%\boost\ptr_container
-+mkdir: %_DEST%\inc%_EXT%\boost\ptr_container\detail
-+mkdir: %_DEST%\inc%_EXT%\boost\range
-+mkdir: %_DEST%\inc%_EXT%\boost\range\detail
- mkdir: %_DEST%\inc%_EXT%\boost\spirit
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\actor
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\attribute
-@@ -155,6 +159,7 @@ mkdir: %_DEST%\inc%_EXT%\boost\tuple\detail
- mkdir: %_DEST%\inc%_EXT%\boost\type_traits
- mkdir: %_DEST%\inc%_EXT%\boost\type_traits\detail
- mkdir: %_DEST%\inc%_EXT%\boost\utility
-+mkdir: %_DEST%\inc%_EXT%\boost\utility\detail
- mkdir: %_DEST%\inc%_EXT%\boost\variant
- mkdir: %_DEST%\inc%_EXT%\boost\variant\detail
-
-@@ -240,6 +245,10 @@ mkdir: %_DEST%\inc%_EXT%\boost\variant\detail
- ..\%__SRC%\inc\boost\preprocessor\slot\* %_DEST%\inc%_EXT%\boost\preprocessor\slot
- ..\%__SRC%\inc\boost\preprocessor\slot\detail\* %_DEST%\inc%_EXT%\boost\preprocessor\slot\detail
- ..\%__SRC%\inc\boost\preprocessor\tuple\* %_DEST%\inc%_EXT%\boost\preprocessor\tuple
-+..\%__SRC%\inc\boost\ptr_container\* %_DEST%\inc%_EXT%\boost\ptr_container
-+..\%__SRC%\inc\boost\ptr_container\detail\* %_DEST%\inc%_EXT%\boost\ptr_container\detail
-+..\%__SRC%\inc\boost\range\* %_DEST%\inc%_EXT%\boost\range
-+..\%__SRC%\inc\boost\range\detail\* %_DEST%\inc%_EXT%\boost\range\detail
- ..\%__SRC%\inc\boost\spirit\* %_DEST%\inc%_EXT%\boost\spirit
- ..\%__SRC%\inc\boost\spirit\actor\* %_DEST%\inc%_EXT%\boost\spirit\actor
- ..\%__SRC%\inc\boost\spirit\attribute\* %_DEST%\inc%_EXT%\boost\spirit\attribute
-@@ -306,6 +315,7 @@ mkdir: %_DEST%\inc%_EXT%\boost\variant\detail
- ..\%__SRC%\inc\boost\type_traits\* %_DEST%\inc%_EXT%\boost\type_traits
- ..\%__SRC%\inc\boost\type_traits\detail\* %_DEST%\inc%_EXT%\boost\type_traits\detail
- ..\%__SRC%\inc\boost\utility\* %_DEST%\inc%_EXT%\boost\utility
-+..\%__SRC%\inc\boost\utility\detail\* %_DEST%\inc%_EXT%\boost\utility\detail
- ..\%__SRC%\inc\boost\variant\* %_DEST%\inc%_EXT%\boost\variant
- ..\%__SRC%\inc\boost\variant\detail\* %_DEST%\inc%_EXT%\boost\variant\detail
- ..\%__SRC%\misc\build\boost_1_39_0\boost\concept\* %_DEST%\inc%_EXT%\boost\concept
---
-1.7.0.1
-
diff --git a/patches/dev300/calc-autodecimal-ods-fix.diff b/patches/dev300/calc-autodecimal-ods-fix.diff
deleted file mode 100644
index bd18b1f..0000000
--- a/patches/dev300/calc-autodecimal-ods-fix.diff
+++ /dev/null
@@ -1,53 +0,0 @@
-From 90d9d9e6d6f7eaf407df3157612dfb96fdd3f34b Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 17:08:27 +0200
-Subject: [PATCH 720/768] calc-autodecimal-ods-fix.diff
-
----
- sc/source/core/tool/docoptio.cxx | 2 +-
- sc/source/ui/unoobj/defltuno.cxx | 9 ++++++++-
- 2 files changed, 9 insertions(+), 2 deletions(-)
-
-diff --git sc/source/core/tool/docoptio.cxx sc/source/core/tool/docoptio.cxx
-index 7979335..28ef8da 100644
---- sc/source/core/tool/docoptio.cxx
-+++ sc/source/core/tool/docoptio.cxx
-@@ -125,7 +125,7 @@ void ScDocOptions::ResetDocOptions()
- bIsIter = FALSE;
- nIterCount = 100;
- fIterEps = 1.0E-3;
-- nPrecStandardFormat = 2;
-+ nPrecStandardFormat = SvNumberFormatter::UNLIMITED_PRECISION;
- nDay = 30;
- nMonth = 12;
- nYear = 1899;
-diff --git sc/source/ui/unoobj/defltuno.cxx sc/source/ui/unoobj/defltuno.cxx
-index 0b1d5f9..f74e8b9 100644
---- sc/source/ui/unoobj/defltuno.cxx
-+++ sc/source/ui/unoobj/defltuno.cxx
-@@ -46,6 +46,8 @@
- #include "unonames.hxx"
- #include "docoptio.hxx"
-
-+#include <limits>
-+
- using namespace ::com::sun::star;
-
- //------------------------------------------------------------------------
-@@ -250,7 +252,12 @@ uno::Any SAL_CALL ScDocDefaultsObj::getPropertyValue( const rtl::OUString& aProp
- if (pDoc)
- {
- const ScDocOptions& aDocOpt = pDoc->GetDocOptions();
-- aRet <<= static_cast<sal_Int16> (aDocOpt.GetStdPrecision());
-+ sal_uInt16 nPrec = aDocOpt.GetStdPrecision();
-+ // the max value of unsigned 16-bit integer is used as the flag
-+ // value for unlimited precision, c.f.
-+ // SvNumberFormatter::UNLIMITED_PRECISION.
-+ if (nPrec <= ::std::numeric_limits<sal_Int16>::max())
-+ aRet <<= static_cast<sal_Int16> (nPrec);
- }
- else
- throw uno::RuntimeException();
---
-1.7.0.1
-
diff --git a/patches/dev300/calc-filter-dbf-precision.diff b/patches/dev300/calc-filter-dbf-precision.diff
index ff9c101..34af7be 100644
--- a/patches/dev300/calc-filter-dbf-precision.diff
+++ b/patches/dev300/calc-filter-dbf-precision.diff
@@ -12,24 +12,28 @@ diff --git sc/source/core/data/column3.cxx sc/source/core/data/column3.cxx
index 769b830..1481732 100644
--- sc/source/core/data/column3.cxx
+++ sc/source/core/data/column3.cxx
-@@ -1946,10 +1946,16 @@ xub_StrLen ScColumn::GetMaxNumberStringLen( USHORT& nPrecision,
+@@ -1946,10 +1946,20 @@ xub_StrLen ScColumn::GetMaxNumberStringLen( USHORT& nPrecision,
if ( nLen )
{
if ( nFormat )
- { // more decimals than standard?
-- USHORT nPrec = pNumFmt->GetFormatPrecision( nFormat );
-- if ( nPrec > nPrecision )
+- sal_uInt16 nPrec = pNumFmt->GetFormatPrecision( nFormat );
+- if ( nPrec != SvNumberFormatter::UNLIMITED_PRECISION && nPrec > nPrecision )
- nPrecision = nPrec;
+ {
+ const SvNumberformat* pEntry = pNumFmt->GetEntry( nFormat );
++ sal_uInt16 nPrec;
+ if (pEntry)
+ {
+ BOOL bThousand, bNegRed;
+ USHORT nLeading;
-+ pEntry->GetFormatSpecialInfo(bThousand, bNegRed, nPrecision, nLeading);
++ pEntry->GetFormatSpecialInfo(bThousand, bNegRed, nPrec, nLeading);
+ }
+ else
-+ nPrecision = pNumFmt->GetFormatPrecision( nFormat );
++ nPrec = pNumFmt->GetFormatPrecision( nFormat );
++
++ if ( nPrec != SvNumberFormatter::UNLIMITED_PRECISION && nPrec > nPrecision )
++ nPrecision = nPrec;
}
if ( nPrecision )
{ // less than nPrecision in string => widen it
commit c42e473b2588a68a46b945087f1126a8e14e4d16
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Thu May 20 22:41:05 2010 -0400
Backport of koheiautodecimal cws. The old patches are now removed.
* patches/dev300/apply:
* patches/dev300/calc-general-type-auto-decimal-disable-linebreak.diff:
* patches/dev300/calc-general-type-auto-decimal-ieee754-fix.diff:
* patches/dev300/calc-general-type-auto-decimal-officecfg.diff:
* patches/dev300/calc-general-type-auto-decimal-printer-matrix-fix.diff:
* patches/dev300/calc-general-type-auto-decimal-sc-dbf-fix.diff:
* patches/dev300/calc-general-type-auto-decimal-sc.diff:
* patches/dev300/calc-general-type-auto-decimal-svtools.diff:
* patches/dev300/cws-koheiautodecimal-boost.diff:
* patches/dev300/cws-koheiautodecimal-sc.diff:
* patches/dev300/cws-koheiautodecimal-svl.diff:
* patches/dev300/cws-koheiautodecimal-testautomation.diff:
diff --git a/patches/dev300/apply b/patches/dev300/apply
index ab27057..04e0762 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -179,6 +179,12 @@ helpcontent-scalc-01.diff, kohei
# FIXME dev300-m77 helpcontent-scalc-01-localize.diff, kohei
[ CWSBackports ]
+# automatic decimal adjustment per column width.
+cws-koheiautodecimal-boost.diff, kohei
+cws-koheiautodecimal-sc.diff, kohei
+cws-koheiautodecimal-svl.diff, kohei
+cws-koheiautodecimal-testautomation.diff, kohei
+
# calctabcolor cws (tab color feature by Daniel Watson)
cws-calctabcolor-filter.diff, kohei
cws-calctabcolor-officecfg.diff, kohei
@@ -806,22 +812,6 @@ calc-find-replace-skip-filtered-sc.diff, n#539282, n#580408, kohei
# 2003 and 2007 happy.
calc-combo-listbox-export-fix.diff, n#540566, noelp
-# When the cell format is 'General', automatically adjust the number of decimals
-# to be displayed based on the cell value.
-calc-general-type-auto-decimal-sc.diff, n#541973, i#46511, kohei
-calc-general-type-auto-decimal-svtools.diff, n#541973, i#46511, kohei
-calc-general-type-auto-decimal-officecfg.diff, n#541973, i#46511, kohei
-calc-general-type-auto-decimal-sc-dbf-fix.diff, i#111074, kohei
-
-# Disable text wrap for numeric values.
-calc-general-type-auto-decimal-disable-linebreak.diff, kohei
-
-# Tweak the default display format to hide the ugliness of IEEE 754 rounding error.
-calc-general-type-auto-decimal-ieee754-fix.diff, i#111533, kohei
-
-# Fix automatic decimals when the printer matrics is used.
-calc-general-type-auto-decimal-printer-matrix-fix.diff, i#111559, kohei
-
# FIXME. hack. readd XclExpInterfaceEnd::WriteBody as in m60 as
# calc-xls-export-encryption-condfmt-fix.diff patches it. Kohei, please check
# --rengelhard
diff --git a/patches/dev300/calc-general-type-auto-decimal-disable-linebreak.diff b/patches/dev300/calc-general-type-auto-decimal-disable-linebreak.diff
deleted file mode 100644
index c59f4ed..0000000
--- a/patches/dev300/calc-general-type-auto-decimal-disable-linebreak.diff
+++ /dev/null
@@ -1,119 +0,0 @@
-From 4c1725017426964e53eef5a385e92419ea78cfa8 Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 16:56:27 +0200
-Subject: [PATCH 183/768] calc-general-type-auto-decimal-disable-linebreak.diff
-
----
- sc/source/core/data/column2.cxx | 12 ++++++++----
- sc/source/ui/view/output2.cxx | 24 ++++++++++++++++++++----
- 2 files changed, 28 insertions(+), 8 deletions(-)
-
-diff --git sc/source/core/data/column2.cxx sc/source/core/data/column2.cxx
-index a16cb77..94d3b98 100644
---- sc/source/core/data/column2.cxx
-+++ sc/source/core/data/column2.cxx
-@@ -193,6 +193,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
- double nPPT = bWidth ? nPPTX : nPPTY;
- if (Search(nRow,nIndex))
- {
-+ ScBaseCell* pCell = pItems[nIndex].pCell;
- const ScPatternAttr* pPattern = rOptions.pPattern;
- if (!pPattern)
- pPattern = pAttrArray->GetPattern( nRow );
-@@ -233,22 +234,26 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
- else
- eHorJust = (SvxCellHorJustify)((const SvxHorJustifyItem&)
- pPattern->GetItem( ATTR_HOR_JUSTIFY )).GetValue();
-- BOOL bBreak;
-+ bool bBreak;
- if ( eHorJust == SVX_HOR_JUSTIFY_BLOCK )
-- bBreak = TRUE;
-+ bBreak = true;
- else if ( pCondSet &&
- pCondSet->GetItemState(ATTR_LINEBREAK, TRUE, &pCondItem) == SFX_ITEM_SET)
- bBreak = ((const SfxBoolItem*)pCondItem)->GetValue();
- else
- bBreak = ((const SfxBoolItem&)pPattern->GetItem(ATTR_LINEBREAK)).GetValue();
-
-+ if (pCell->HasValueData())
-+ // Cell has a value. Disable line break.
-+ bBreak = false;
-+
- // get other attributes from pattern and conditional formatting
-
- SvxCellOrientation eOrient = pPattern->GetCellOrientation( pCondSet );
- BOOL bAsianVertical = ( eOrient == SVX_ORIENTATION_STACKED &&
- ((const SfxBoolItem&)pPattern->GetItem( ATTR_VERTICAL_ASIAN, pCondSet )).GetValue() );
- if ( bAsianVertical )
-- bBreak = FALSE;
-+ bBreak = false;
-
- if ( bWidth && bBreak ) // after determining bAsianVertical (bBreak may be reset)
- return 0;
-@@ -300,7 +305,6 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
- nIndent = ((const SfxUInt16Item&)pPattern->GetItem(ATTR_INDENT)).GetValue();
- }
-
-- ScBaseCell* pCell = pItems[nIndex].pCell;
- BYTE nScript = pDocument->GetScriptType( nCol, nRow, nTab, pCell );
- if (nScript == 0) nScript = ScGlobal::GetDefaultScriptType();
-
-diff --git sc/source/ui/view/output2.cxx sc/source/ui/view/output2.cxx
-index 1ff9cc8..ad6184b 100644
---- sc/source/ui/view/output2.cxx
-+++ sc/source/ui/view/output2.cxx
-@@ -75,6 +75,8 @@
- #include "scmod.hxx"
- #include "fillinfo.hxx"
-
-+#include <boost/scoped_ptr.hpp>
-+
- #include <math.h>
-
- //! Autofilter-Breite mit column.cxx zusammenfassen
-@@ -1293,10 +1295,6 @@ void ScOutputData::DrawStrings( BOOL bPixelToLogic )
-
- ScDrawStringsVars aVars( this, bPixelToLogic );
-
-- const ScPatternAttr* pOldPattern = NULL;
-- const SfxItemSet* pOldCondSet = NULL;
-- BYTE nOldScript = 0;
--
- BOOL bProgress = FALSE;
-
- long nInitPosX = nScrX;
-@@ -1319,6 +1317,13 @@ void ScOutputData::DrawStrings( BOOL bPixelToLogic )
- SvxCellHorJustify eOutHorJust = SVX_HOR_JUSTIFY_STANDARD;
- const ScPatternAttr* pPattern = NULL;
- const SfxItemSet* pCondSet = NULL;
-+ const ScPatternAttr* pOldPattern = NULL;
-+ const SfxItemSet* pOldCondSet = NULL;
-+ BYTE nOldScript = 0;
-+
-+ // alternative pattern instance in case we need to modify the pattern
-+ // before processing the cell value.
-+ ::boost::scoped_ptr<ScPatternAttr> pAltPattern;
-
- long nPosY = nScrY;
- for (SCSIZE nArrY=1; nArrY+1<nArrCount; nArrY++)
-@@ -1456,6 +1461,17 @@ void ScOutputData::DrawStrings( BOOL bPixelToLogic )
- pCondSet = pDoc->GetCondResult( nCellX, nCellY, nTab );
- }
-
-+ if (pCell->HasValueData() &&
-+ static_cast<const SfxBoolItem&>(
-+ pPattern->GetItem(ATTR_LINEBREAK, pCondSet)).GetValue())
-+ {
-+ // Disable line break when the cell content is numeric.
-+ pAltPattern.reset(new ScPatternAttr(*pPattern));
-+ SfxBoolItem aLineBreak(ATTR_LINEBREAK, false);
-+ pAltPattern->GetItemSet().Put(aLineBreak);
-+ pPattern = pAltPattern.get();
-+ }
-+
- BYTE nScript = GetScriptType( pDoc, pCell, pPattern, pCondSet );
- if (nScript == 0) nScript = ScGlobal::GetDefaultScriptType();
- if ( pPattern != pOldPattern || pCondSet != pOldCondSet ||
---
-1.7.0.1
-
diff --git a/patches/dev300/calc-general-type-auto-decimal-ieee754-fix.diff b/patches/dev300/calc-general-type-auto-decimal-ieee754-fix.diff
deleted file mode 100644
index 40b9232..0000000
--- a/patches/dev300/calc-general-type-auto-decimal-ieee754-fix.diff
+++ /dev/null
@@ -1,45 +0,0 @@
-From dda14724c0ba21ae09da8e80388b5d9c13f05798 Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 16:56:28 +0200
-Subject: [PATCH 184/768] calc-general-type-auto-decimal-ieee754-fix.diff
-
----
- svl/source/numbers/zformat.cxx | 12 ++++++------
- 1 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git svl/source/numbers/zformat.cxx svl/source/numbers/zformat.cxx
-index 3d949c9..abe642a 100644
---- svl/source/numbers/zformat.cxx
-+++ svl/source/numbers/zformat.cxx
-@@ -1824,14 +1824,14 @@ void SvNumberformat::ImpGetOutputStdToPrecision(double& rNumber, String& rOutStr
- }
- #endif
-
-- // If truncating the value to desired precision alters the original value,
-- // we should show the trailing zeros, otherwise strip them.
-- double fRounded = ::rtl::math::round(rNumber, nPrecision);
-- bool bRemoveZeros = ::rtl::math::approxEqual(fRounded, rNumber);
-+ // We decided to strip trailing zeros unconditionally, since binary
-+ // double-precision rounding error makes it impossible to determine e.g.
-+ // whether 844.10000000000002273737 is what the user has typed, or the
-+ // user has typed 844.1 but IEEE 754 represents it that way internally.
-
- rOutString = ::rtl::math::doubleToUString( rNumber,
- rtl_math_StringFormat_F, nPrecision /*2*/,
-- GetFormatter().GetNumDecimalSep().GetChar(0), bRemoveZeros );
-+ GetFormatter().GetNumDecimalSep().GetChar(0), true );
- if (rOutString.GetChar(0) == '-' &&
- rOutString.GetTokenCount('0') == rOutString.Len())
- rOutString.EraseLeadingChars('-'); // nicht -0
-@@ -2079,7 +2079,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
- bool bSign = ::rtl::math::isSignBitSet(fNumber);
- if (bSign)
- fNumber = -fNumber;
-- ImpGetOutputInputLine(fNumber, OutString);
-+ ImpGetOutputStdToPrecision(fNumber, OutString, 10); // Use 10 decimals for general 'unlimited' format.
- if (fNumber < EXP_LOWER_BOUND)
- {
- xub_StrLen nLen = OutString.Len();
---
-1.7.0.1
-
diff --git a/patches/dev300/calc-general-type-auto-decimal-officecfg.diff b/patches/dev300/calc-general-type-auto-decimal-officecfg.diff
deleted file mode 100644
index 7a53a1c..0000000
--- a/patches/dev300/calc-general-type-auto-decimal-officecfg.diff
+++ /dev/null
@@ -1,25 +0,0 @@
-From 4c8d3cd0b4591e9b17378b8a259ac99fbc96471f Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 16:56:24 +0200
-Subject: [PATCH 181/768] calc-general-type-auto-decimal-officecfg.diff
-
----
- .../registry/schema/org/openoffice/Office/Calc.xcs | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git officecfg/registry/schema/org/openoffice/Office/Calc.xcs officecfg/registry/schema/org/openoffice/Office/Calc.xcs
-index 80b5f03..a868cf8 100644
---- officecfg/registry/schema/org/openoffice/Office/Calc.xcs
-+++ officecfg/registry/schema/org/openoffice/Office/Calc.xcs
-@@ -1206,7 +1206,7 @@
- <desc>Specifies the number of decimals to be displayed for the Standard number format.</desc>
- <label>Decimal places</label>
- </info>
-- <value>2</value>
-+ <value>-1</value>
- </prop>
- <prop oor:name="RegularExpressions" oor:type="xs:boolean">
- <!-- UIHints: Tools - Options Spreadsheet Calculate [Check box] Enable regular expressions in formulas -->
---
-1.7.0.1
-
diff --git a/patches/dev300/calc-general-type-auto-decimal-printer-matrix-fix.diff b/patches/dev300/calc-general-type-auto-decimal-printer-matrix-fix.diff
deleted file mode 100644
index b64abb4..0000000
--- a/patches/dev300/calc-general-type-auto-decimal-printer-matrix-fix.diff
+++ /dev/null
@@ -1,80 +0,0 @@
-From 8544c41c953dae65f41c8c9b3a8c7a39532ab199 Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 16:56:29 +0200
-Subject: [PATCH 185/768] calc-general-type-auto-decimal-printer-matrix-fix.diff
-
----
- sc/source/ui/view/output2.cxx | 22 +++++++++++++++++++++-
- 1 files changed, 21 insertions(+), 1 deletions(-)
-
-diff --git sc/source/ui/view/output2.cxx sc/source/ui/view/output2.cxx
-index ad6184b..4aa7472 100644
---- sc/source/ui/view/output2.cxx
-+++ sc/source/ui/view/output2.cxx
-@@ -174,6 +174,7 @@ private:
- long GetSignWidth();
- long GetDotWidth();
- void TextChanged();
-+ long ConvertWidthLogicToPixel( long nWidth ) const;
- };
-
- //==================================================================
-@@ -571,7 +572,12 @@ void ScDrawStringsVars::SetTextToWidthOrHash( ScBaseCell* pCell, long nWidth )
- return;
- }
-
-- if (pOutput->pFmtDevice->GetTextWidth(aString) > nWidth)
-+ long nActualTextWidth = pOutput->pFmtDevice->GetTextWidth(aString);
-+
-+ if (bPixelToLogic)
-+ nActualTextWidth = ConvertWidthLogicToPixel(nActualTextWidth);
-+
-+ if (nActualTextWidth > nWidth)
- {
- // Even after the decimal adjustment the text doesn't fit. Give up.
- SetHashText();
-@@ -623,6 +629,9 @@ long ScDrawStringsVars::GetMaxDigitWidth()
- long n = pOutput->pFmtDevice->GetTextWidth(String(cDigit));
- nMaxDigitWidth = ::std::max(nMaxDigitWidth, n);
- }
-+
-+ if (bPixelToLogic)
-+ nMaxDigitWidth = ConvertWidthLogicToPixel(nMaxDigitWidth);
- return nMaxDigitWidth;
- }
-
-@@ -632,6 +641,8 @@ long ScDrawStringsVars::GetSignWidth()
- return nSignWidth;
-
- nSignWidth = pOutput->pFmtDevice->GetTextWidth(String('-'));
-+ if (bPixelToLogic)
-+ nSignWidth = ConvertWidthLogicToPixel(nSignWidth);
- return nSignWidth;
- }
-
-@@ -642,6 +653,8 @@ long ScDrawStringsVars::GetDotWidth()
-
- const ::rtl::OUString& sep = ScGlobal::GetpLocaleData()->getLocaleItem().decimalSeparator;
- nDotWidth = pOutput->pFmtDevice->GetTextWidth(sep);
-+ if (bPixelToLogic)
-+ nDotWidth = ConvertWidthLogicToPixel(nDotWidth);
- return nDotWidth;
- }
-
-@@ -671,6 +684,13 @@ void ScDrawStringsVars::TextChanged()
- aTextSize = pRefDevice->LogicToPixel( aTextSize );
- }
-
-+long ScDrawStringsVars::ConvertWidthLogicToPixel( long nWidth ) const
-+{
-+ Size aSize(nWidth, pOutput->pFmtDevice->GetTextHeight());
-+ aSize = pOutput->pRefDevice->LogicToPixel(aSize);
-+ return aSize.Width();
-+}
-+
- BOOL ScDrawStringsVars::HasEditCharacters() const
- {
- static const sal_Unicode pChars[] =
---
-1.7.0.1
-
diff --git a/patches/dev300/calc-general-type-auto-decimal-sc-dbf-fix.diff b/patches/dev300/calc-general-type-auto-decimal-sc-dbf-fix.diff
deleted file mode 100644
index 74c5d13..0000000
--- a/patches/dev300/calc-general-type-auto-decimal-sc-dbf-fix.diff
+++ /dev/null
@@ -1,143 +0,0 @@
-From e8f44f60b4ccf5c9f109d42cc3422196cd60422e Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 16:56:25 +0200
-Subject: [PATCH 182/768] calc-general-type-auto-decimal-sc-dbf-fix.diff
-
----
- sc/inc/column.hxx | 2 +-
- sc/inc/document.hxx | 2 +-
- sc/inc/table.hxx | 2 +-
- sc/source/core/data/column3.cxx | 14 ++++++++++++--
- sc/source/core/data/documen4.cxx | 2 +-
- sc/source/core/data/table3.cxx | 2 +-
- sc/source/ui/docshell/docsh8.cxx | 2 +-
- 7 files changed, 18 insertions(+), 8 deletions(-)
-
-diff --git sc/inc/column.hxx sc/inc/column.hxx
-index 2f11838..f900fbf 100644
---- sc/inc/column.hxx
-+++ sc/inc/column.hxx
-@@ -399,7 +399,7 @@ public:
- void CompileColRowNameFormula();
-
- sal_Int32 GetMaxStringLen( SCROW nRowStart, SCROW nRowEnd, CharSet eCharSet ) const;
-- xub_StrLen GetMaxNumberStringLen( USHORT& nPrecision,
-+ xub_StrLen GetMaxNumberStringLen( sal_uInt16& nPrecision,
- SCROW nRowStart, SCROW nRowEnd ) const;
-
- private:
-diff --git sc/inc/document.hxx sc/inc/document.hxx
-index fff03fe..c81684b 100644
---- sc/inc/document.hxx
-+++ sc/inc/document.hxx
-@@ -1706,7 +1706,7 @@ public:
- /** Maximum string length of numerical cells of a column, e.g. for dBase export.
- @return String length in characters (!) including the decimal
- separator, and the decimal precision needed. */
-- xub_StrLen GetMaxNumberStringLen( USHORT& nPrecision,
-+ xub_StrLen GetMaxNumberStringLen( sal_uInt16& nPrecision,
- SCTAB nTab, SCCOL nCol,
- SCROW nRowStart, SCROW nRowEnd ) const;
-
-diff --git sc/inc/table.hxx sc/inc/table.hxx
-index d039590..986fda5 100644
---- sc/inc/table.hxx
-+++ sc/inc/table.hxx
-@@ -659,7 +659,7 @@ public:
-
- sal_Int32 GetMaxStringLen( SCCOL nCol,
- SCROW nRowStart, SCROW nRowEnd, CharSet eCharSet ) const;
-- xub_StrLen GetMaxNumberStringLen( USHORT& nPrecision,
-+ xub_StrLen GetMaxNumberStringLen( sal_uInt16& nPrecision,
- SCCOL nCol,
- SCROW nRowStart, SCROW nRowEnd ) const;
-
-diff --git sc/source/core/data/column3.cxx sc/source/core/data/column3.cxx
-index c22a613..1ac52d3 100644
---- sc/source/core/data/column3.cxx
-+++ sc/source/core/data/column3.cxx
-@@ -1937,11 +1937,15 @@ sal_Int32 ScColumn::GetMaxStringLen( SCROW nRowStart, SCROW nRowEnd, CharSet eCh
- }
-
-
--xub_StrLen ScColumn::GetMaxNumberStringLen( USHORT& nPrecision,
-+xub_StrLen ScColumn::GetMaxNumberStringLen( sal_uInt16& nPrecision,
- SCROW nRowStart, SCROW nRowEnd ) const
- {
- xub_StrLen nStringLen = 0;
- nPrecision = pDocument->GetDocOptions().GetStdPrecision();
-+ if ( nPrecision == SvNumberFormatter::UNLIMITED_PRECISION )
-+ // In case of unlimited precision, use 2 instead.
-+ nPrecision = 2;
-+
- if ( pItems )
- {
- String aString;
-@@ -1962,6 +1966,7 @@ xub_StrLen ScColumn::GetMaxNumberStringLen( USHORT& nPrecision,
- xub_StrLen nLen = aString.Len();
- if ( nLen )
- {
-+ sal_uInt16 nNewPrec = SvNumberFormatter::UNLIMITED_PRECISION;
- if ( nFormat )
- {
- const SvNumberformat* pEntry = pNumFmt->GetEntry( nFormat );
-@@ -1969,11 +1974,16 @@ xub_StrLen ScColumn::GetMaxNumberStringLen( USHORT& nPrecision,
- {
- BOOL bThousand, bNegRed;
- USHORT nLeading;
-- pEntry->GetFormatSpecialInfo(bThousand, bNegRed, nPrecision, nLeading);
-+ pEntry->GetFormatSpecialInfo(bThousand, bNegRed, nNewPrec, nLeading);
- }
- else
- nPrecision = pNumFmt->GetFormatPrecision( nFormat );
- }
-+
-+ if (nNewPrec != SvNumberFormatter::UNLIMITED_PRECISION)
-+ // Skip unlimited precisions.
-+ nPrecision = nNewPrec;
-+
- if ( nPrecision )
- { // less than nPrecision in string => widen it
- // more => shorten it
-diff --git sc/source/core/data/documen4.cxx sc/source/core/data/documen4.cxx
-index 4132381..cbd55fd 100644
---- sc/source/core/data/documen4.cxx
-+++ sc/source/core/data/documen4.cxx
-@@ -430,7 +430,7 @@ sal_Int32 ScDocument::GetMaxStringLen( SCTAB nTab, SCCOL nCol,
- return 0;
- }
-
--xub_StrLen ScDocument::GetMaxNumberStringLen( USHORT& nPrecision, SCTAB nTab,
-+xub_StrLen ScDocument::GetMaxNumberStringLen( sal_uInt16& nPrecision, SCTAB nTab,
- SCCOL nCol,
- SCROW nRowStart, SCROW nRowEnd ) const
- {
-diff --git sc/source/core/data/table3.cxx sc/source/core/data/table3.cxx
-index 31be80f..61cc051 100644
---- sc/source/core/data/table3.cxx
-+++ sc/source/core/data/table3.cxx
-@@ -2034,7 +2034,7 @@ sal_Int32 ScTable::GetMaxStringLen( SCCOL nCol, SCROW nRowStart,
- return 0;
- }
-
--xub_StrLen ScTable::GetMaxNumberStringLen( USHORT& nPrecision, SCCOL nCol,
-+xub_StrLen ScTable::GetMaxNumberStringLen( sal_uInt16& nPrecision, SCCOL nCol,
- SCROW nRowStart, SCROW nRowEnd ) const
- {
- if ( ValidCol(nCol) )
-diff --git sc/source/ui/docshell/docsh8.cxx sc/source/ui/docshell/docsh8.cxx
-index 88145cf..2d7fd46 100644
---- sc/source/ui/docshell/docsh8.cxx
-+++ sc/source/ui/docshell/docsh8.cxx
-@@ -655,7 +655,7 @@ void lcl_GetColumnTypes( ScDocShell& rDocShell,
- else if ( nDbType == sdbc::DataType::DECIMAL )
- { // maximale Feldbreite und Nachkommastellen bestimmen
- xub_StrLen nLen;
-- USHORT nPrec;
-+ sal_uInt16 nPrec;
- nLen = pDoc->GetMaxNumberStringLen( nPrec, nTab, nCol,
- nFirstDataRow, nLastRow );
- // dBaseIII Limit Nachkommastellen: 15
---
-1.7.0.1
-
diff --git a/patches/dev300/calc-general-type-auto-decimal-sc.diff b/patches/dev300/calc-general-type-auto-decimal-sc.diff
deleted file mode 100644
index 888bb32..0000000
--- a/patches/dev300/calc-general-type-auto-decimal-sc.diff
+++ /dev/null
@@ -1,1186 +0,0 @@
-From b21d6bac1de6375e49c1d94d556f97237cc217c6 Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 16:56:22 +0200
-Subject: [PATCH 179/768] calc-general-type-auto-decimal-sc.diff
-
----
- sc/inc/docoptio.hxx | 6 +-
- sc/source/ui/inc/optdlg.hrc | 1 +
- sc/source/ui/inc/output.hxx | 23 ++-
- sc/source/ui/inc/tpcalc.hxx | 1 +
- sc/source/ui/optdlg/tpcalc.cxx | 59 ++++-
- sc/source/ui/src/optdlg.src | 38 ++--
- sc/source/ui/unoobj/defltuno.cxx | 2 +-
- sc/source/ui/view/output2.cxx | 447 ++++++++++++++++++++++++--------------
- 8 files changed, 377 insertions(+), 200 deletions(-)
-
-diff --git sc/inc/docoptio.hxx sc/inc/docoptio.hxx
-index 6c53ce2..8db36bd 100644
---- sc/inc/docoptio.hxx
-+++ sc/inc/docoptio.hxx
-@@ -40,7 +40,7 @@ class SC_DLLPUBLIC ScDocOptions
- {
- double fIterEps; // Epsilon-Wert dazu
- USHORT nIterCount; // Anzahl
-- USHORT nPrecStandardFormat; // Nachkommastellen Standard
-+ sal_uInt16 nPrecStandardFormat; // precision for standard format
- USHORT nDay; // Nulldatum:
- USHORT nMonth;
- USHORT nYear;
-@@ -93,8 +93,8 @@ public:
- inline int operator==( const ScDocOptions& rOpt ) const;
- inline int operator!=( const ScDocOptions& rOpt ) const;
-
-- USHORT GetStdPrecision() const { return nPrecStandardFormat; }
-- void SetStdPrecision( USHORT n ) { nPrecStandardFormat = n; }
-+ sal_uInt16 GetStdPrecision() const { return nPrecStandardFormat; }
-+ void SetStdPrecision( sal_uInt16 n ) { nPrecStandardFormat = n; }
-
- BOOL IsCalcAsShown() const { return bCalcAsShown; }
- void SetCalcAsShown( BOOL bVal ) { bCalcAsShown = bVal; }
-diff --git sc/source/ui/inc/optdlg.hrc sc/source/ui/inc/optdlg.hrc
-index 4f4554d..7860ad3 100644
---- sc/source/ui/inc/optdlg.hrc
-+++ sc/source/ui/inc/optdlg.hrc
-@@ -71,6 +71,7 @@
- #define BTN_MATCH 18
- #define BTN_LOOKUP 19
- #define BTN_REGEX 20
-+#define BTN_GENERAL_PREC 21
-
- // TP_VIEW:
- #define BTN_VSCROLL 1
-diff --git sc/source/ui/inc/output.hxx sc/source/ui/inc/output.hxx
-index 277c619..e9e3d30 100644
---- sc/source/ui/inc/output.hxx
-+++ sc/source/ui/inc/output.hxx
-@@ -73,6 +73,15 @@ class ScOutputData
- {
- friend class ScDrawStringsVars;
- private:
-+ struct OutputAreaParam
-+ {
-+ Rectangle maAlignRect;
-+ Rectangle maClipRect;
-+ long mnColWidth;
-+ bool mbLeftClip;
-+ bool mbRightClip;
-+ };
-+
- OutputDevice* pDev; // Device
- OutputDevice* pRefDevice; // printer if used for preview
- OutputDevice* pFmtDevice; // reference for text formatting
-@@ -152,19 +161,19 @@ private:
- void GetVisibleCell( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell*& rpCell );
-
- BOOL IsAvailable( SCCOL nX, SCROW nY );
-+
- void GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY,
-- SCCOL nCellX, SCROW nCellY, long nNeeded,
-- const ScPatternAttr& rPattern,
-- USHORT nHorJustify, BOOL bCellIsValue,
-- BOOL bBreak, BOOL bOverwrite,
-- Rectangle& rAlignRect, Rectangle& rClipRect,
-- BOOL& rLeftClip, BOOL& rRightClip );
-+ SCCOL nCellX, SCROW nCellY, long nNeeded,
-+ const ScPatternAttr& rPattern,
-+ USHORT nHorJustify, bool bCellIsValue,
-+ bool bBreak, bool bOverwrite,
-+ OutputAreaParam& rParam );
-
- void ShrinkEditEngine( EditEngine& rEngine, const Rectangle& rAlignRect,
- long nLeftM, long nTopM, long nRightM, long nBottomM,
- BOOL bWidth, USHORT nOrient, long nAttrRotate, BOOL bPixelToLogic,
- long& rEngineWidth, long& rEngineHeight, long& rNeededPixel,
-- BOOL& rLeftClip, BOOL& rRightClip );
-+ bool& rLeftClip, bool& rRightClip );
-
- void SetSyntaxColor( Font* pFont, ScBaseCell* pCell );
- void SetEditSyntaxColor( EditEngine& rEngine, ScBaseCell* pCell );
-diff --git sc/source/ui/inc/tpcalc.hxx sc/source/ui/inc/tpcalc.hxx
-index 5769f1c..3fe9b76 100644
---- sc/source/ui/inc/tpcalc.hxx
-+++ sc/source/ui/inc/tpcalc.hxx
-@@ -76,6 +76,7 @@ private:
- CheckBox aBtnMatch;
- CheckBox aBtnRegex;
- CheckBox aBtnLookUp;
-+ CheckBox aBtnGeneralPrec;
-
- FixedText aFtPrec;
- NumericField aEdPrec;
-diff --git sc/source/ui/optdlg/tpcalc.cxx sc/source/ui/optdlg/tpcalc.cxx
-index cada6c0..a829002 100644
---- sc/source/ui/optdlg/tpcalc.cxx
-+++ sc/source/ui/optdlg/tpcalc.cxx
-@@ -88,6 +88,7 @@ ScTpCalcOptions::ScTpCalcOptions( Window* pParent,
- aBtnMatch ( this, ScResId( BTN_MATCH ) ),
- aBtnRegex ( this, ScResId( BTN_REGEX ) ),
- aBtnLookUp ( this, ScResId( BTN_LOOKUP ) ),
-+ aBtnGeneralPrec ( this, ScResId( BTN_GENERAL_PREC ) ),
- aFtPrec ( this, ScResId( FT_PREC ) ),
- aEdPrec ( this, ScResId( ED_PREC ) ),
- pOldOptions ( new ScDocOptions(
-@@ -116,6 +117,7 @@ __EXPORT ScTpCalcOptions::~ScTpCalcOptions()
- void ScTpCalcOptions::Init()
- {
- aBtnIterate .SetClickHdl( LINK( this, ScTpCalcOptions, CheckClickHdl ) );
-+ aBtnGeneralPrec.SetClickHdl( LINK(this, ScTpCalcOptions, CheckClickHdl) );
- aBtnDateStd .SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
- aBtnDateSc10.SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
- aBtnDate1904.SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
-@@ -150,7 +152,6 @@ void __EXPORT ScTpCalcOptions::Reset( const SfxItemSet& /* rCoreAttrs */ )
- aBtnLookUp .Check( pLocalOptions->IsLookUpColRowNames() );
- aBtnIterate.Check( pLocalOptions->IsIter() );
- aEdSteps .SetValue( pLocalOptions->GetIterCount() );
-- aEdPrec .SetValue( pLocalOptions->GetStdPrecision() );
- aEdEps .SetValue( pLocalOptions->GetIterEps(), 6 );
-
- pLocalOptions->GetDate( d, m, y );
-@@ -168,6 +169,21 @@ void __EXPORT ScTpCalcOptions::Reset( const SfxItemSet& /* rCoreAttrs */ )
- break;
- }
-
-+ sal_uInt16 nPrec = pLocalOptions->GetStdPrecision();
-+ if (nPrec == SvNumberFormatter::UNLIMITED_PRECISION)
-+ {
-+ aFtPrec.Disable();
-+ aEdPrec.Disable();
-+ aBtnGeneralPrec.Check(false);
-+ }
-+ else
-+ {
-+ aBtnGeneralPrec.Check();
-+ aFtPrec.Enable();
-+ aEdPrec.Enable();
-+ aEdPrec.SetValue(nPrec);
-+ }
-+
- CheckClickHdl( &aBtnIterate );
- }
-
-@@ -178,13 +194,18 @@ BOOL __EXPORT ScTpCalcOptions::FillItemSet( SfxItemSet& rCoreAttrs )
- {
- // alle weiteren Optionen werden in den Handlern aktualisiert
- pLocalOptions->SetIterCount( (USHORT)aEdSteps.GetValue() );
-- pLocalOptions->SetStdPrecision( (USHORT)aEdPrec.GetValue() );
- pLocalOptions->SetIgnoreCase( !aBtnCase.IsChecked() );
- pLocalOptions->SetCalcAsShown( aBtnCalc.IsChecked() );
- pLocalOptions->SetMatchWholeCell( aBtnMatch.IsChecked() );
- pLocalOptions->SetFormulaRegexEnabled( aBtnRegex.IsChecked() );
- pLocalOptions->SetLookUpColRowNames( aBtnLookUp.IsChecked() );
-
-+ if (aBtnGeneralPrec.IsChecked())
-+ pLocalOptions->SetStdPrecision(
-+ static_cast<sal_uInt16>(aEdPrec.GetValue()) );
-+ else
-+ pLocalOptions->SetStdPrecision( SvNumberFormatter::UNLIMITED_PRECISION );
-+
- if ( *pLocalOptions != *pOldOptions )
- {
- rCoreAttrs.Put( ScTpCalcItem( nWhichCalc, *pLocalOptions ) );
-@@ -245,19 +266,35 @@ IMPL_LINK( ScTpCalcOptions, RadioClickHdl, RadioButton*, pBtn )
-
- //-----------------------------------------------------------------------
-
--IMPL_LINK( ScTpCalcOptions, CheckClickHdl, CheckBox*, pBtn )
-+IMPL_LINK( ScTpCalcOptions, CheckClickHdl, CheckBox*, pBtn )
- {
-- if ( pBtn->IsChecked() )
-+ if (pBtn == &aBtnGeneralPrec)
- {
-- pLocalOptions->SetIter( TRUE );
-- aFtSteps.Enable(); aEdSteps.Enable();
-- aFtEps .Enable(); aEdEps .Enable();
-+ if (pBtn->IsChecked())
-+ {
-+ aEdPrec.Enable();
-+ aFtPrec.Enable();
-+ }
-+ else
-+ {
-+ aEdPrec.Disable();
-+ aFtPrec.Disable();
-+ }
- }
-- else
-+ else if (pBtn == &aBtnIterate)
- {
-- pLocalOptions->SetIter( FALSE );
-- aFtSteps.Disable(); aEdSteps.Disable();
-- aFtEps .Disable(); aEdEps .Disable();
-+ if ( pBtn->IsChecked() )
-+ {
-+ pLocalOptions->SetIter( TRUE );
-+ aFtSteps.Enable(); aEdSteps.Enable();
-+ aFtEps .Enable(); aEdEps .Enable();
-+ }
-+ else
-+ {
-+ pLocalOptions->SetIter( FALSE );
-+ aFtSteps.Disable(); aEdSteps.Disable();
-+ aFtEps .Disable(); aEdEps .Disable();
-+ }
- }
-
- return 0;
-diff --git sc/source/ui/src/optdlg.src sc/source/ui/src/optdlg.src
-index 034e2dd..c961cda 100644
---- sc/source/ui/src/optdlg.src
-+++ sc/source/ui/src/optdlg.src
-@@ -119,22 +119,6 @@ TabPage RID_SCPAGE_CALC
- Pos = MAP_APPFONT ( 6 , 64 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- };
-- FixedText FT_PREC
-- {
-- Pos = MAP_APPFONT ( 150 , 77 ) ;
-- Size = MAP_APPFONT ( 72 , 8 ) ;
-- Text [ en-US ] = "~Decimal places" ;
-- Right = TRUE ;
-- };
-- NumericField ED_PREC
-- {
-- Border = TRUE ;
-- Pos = MAP_APPFONT ( 226 , 75 ) ;
-- Size = MAP_APPFONT ( 25 , 12 ) ;
-- Maximum = 20 ;
-- Spin = TRUE ;
-- Repeat = TRUE ;
-- };
- CheckBox BTN_CASE
- {
- Pos = MAP_APPFONT ( 12 , 77 ) ;
-@@ -165,6 +149,28 @@ TabPage RID_SCPAGE_CALC
- Size = MAP_APPFONT ( 239 , 10 ) ;
- Text [ en-US ] = "~Automatically find column and row labels " ;
- };
-+ CheckBox BTN_GENERAL_PREC
-+ {
-+ Pos = MAP_APPFONT ( 12 , 147 ) ;
-+ Size = MAP_APPFONT ( 136 , 10 ) ;
-+ Text [ en-US ] = "Limit decimals for general number format" ;
-+ };
-+ FixedText FT_PREC
-+ {
-+ Pos = MAP_APPFONT ( 150 , 148 ) ;
-+ Size = MAP_APPFONT ( 72 , 8 ) ;
-+ Text [ en-US ] = "~Decimal places" ;
-+ Right = TRUE ;
-+ };
-+ NumericField ED_PREC
-+ {
-+ Border = TRUE ;
-+ Pos = MAP_APPFONT ( 226 , 146 ) ;
-+ Size = MAP_APPFONT ( 25 , 12 ) ;
-+ Maximum = 20 ;
-+ Spin = TRUE ;
-+ Repeat = TRUE ;
-+ };
- };
-
- /**************************************************************************/
-diff --git sc/source/ui/unoobj/defltuno.cxx sc/source/ui/unoobj/defltuno.cxx
-index faa102b..0b1d5f9 100644
---- sc/source/ui/unoobj/defltuno.cxx
-+++ sc/source/ui/unoobj/defltuno.cxx
-@@ -157,7 +157,7 @@ void SAL_CALL ScDocDefaultsObj::setPropertyValue(
- sal_Int16 nValue = 0;
- if (aValue >>= nValue)
- {
-- aDocOpt.SetStdPrecision(static_cast<sal_uInt8> (nValue));
-+ aDocOpt.SetStdPrecision(static_cast<sal_uInt16> (nValue));
- pDoc->SetDocOptions(aDocOpt);
- }
- }
-diff --git sc/source/ui/view/output2.cxx sc/source/ui/view/output2.cxx
-index 03c193b..1ff9cc8 100644
---- sc/source/ui/view/output2.cxx
-+++ sc/source/ui/view/output2.cxx
-@@ -53,6 +53,7 @@
- #include <editeng/udlnitem.hxx>
- #include <editeng/unolingu.hxx>
- #include <svl/zforlist.hxx>
-+#include <svl/zformat.hxx>
- #include <vcl/svapp.hxx>
- #include <vcl/metric.hxx>
- #include <vcl/outdev.hxx>
-@@ -108,6 +109,9 @@ class ScDrawStringsVars
- String aString; // Inhalte
- Size aTextSize;
- long nOriginalWidth;
-+ long nMaxDigitWidth;
-+ long nSignWidth;
-+ long nDotWidth;
-
- ScBaseCell* pLastCell;
- ULONG nValueFormat;
-@@ -132,7 +136,7 @@ public:
- void SetPatternSimple( const ScPatternAttr* pNew, const SfxItemSet* pSet );
-
- BOOL SetText( ScBaseCell* pCell ); // TRUE -> pOldPattern vergessen
-- void SetHashText();
-+ void SetTextToWidthOrHash( ScBaseCell* pCell, long nWidth );
- void SetAutoText( const String& rAutoText );
-
- const ScPatternAttr* GetPattern() const { return pPattern; }
-@@ -161,6 +165,13 @@ public:
- pCondSet->GetItemState( ATTR_FONT_HEIGHT, TRUE ); }
-
- BOOL HasEditCharacters() const;
-+
-+private:
-+ void SetHashText();
-+ long GetMaxDigitWidth();
-+ long GetSignWidth();
-+ long GetDotWidth();
-+ void TextChanged();
- };
-
- //==================================================================
-@@ -176,6 +187,9 @@ ScDrawStringsVars::ScDrawStringsVars(ScOutputData* pData, BOOL bPTL) :
- nIndent ( 0 ),
- bRotated ( FALSE ),
- nOriginalWidth( 0 ),
-+ nMaxDigitWidth( 0 ),
-+ nSignWidth( 0 ),
-+ nDotWidth( 0 ),
- pLastCell ( NULL ),
- nValueFormat( 0 ),
- bLineBreak ( FALSE ),
-@@ -242,6 +256,10 @@ void ScDrawStringsVars::SetShrinkScale( long nScale, BYTE nScript )
- void ScDrawStringsVars::SetPattern( const ScPatternAttr* pNew, const SfxItemSet* pSet,
- ScBaseCell* pCell, BYTE nScript )
- {
-+ nMaxDigitWidth = 0;
-+ nSignWidth = 0;
-+ nDotWidth = 0;
-+
- pPattern = pNew;
- pCondSet = pSet;
-
-@@ -393,6 +411,9 @@ void ScDrawStringsVars::SetPattern( const ScPatternAttr* pNew, const SfxItemSet*
-
- void ScDrawStringsVars::SetPatternSimple( const ScPatternAttr* pNew, const SfxItemSet* pSet )
- {
-+ nMaxDigitWidth = 0;
-+ nSignWidth = 0;
-+ nDotWidth = 0;
- // wird gerufen, wenn sich die Font-Variablen nicht aendern (!StringDiffer)
-
- pPattern = pNew;
-@@ -467,28 +488,7 @@ BOOL ScDrawStringsVars::SetText( ScBaseCell* pCell )
- pLastCell = NULL; // naechstes Mal wieder hierherkommen
- }
-
-- OutputDevice* pRefDevice = pOutput->pRefDevice;
-- OutputDevice* pFmtDevice = pOutput->pFmtDevice;
-- aTextSize.Width() = pFmtDevice->GetTextWidth( aString );
-- aTextSize.Height() = pFmtDevice->GetTextHeight();
--
-- if ( !pRefDevice->GetConnectMetaFile() || pRefDevice->GetOutDevType() == OUTDEV_PRINTER )
-- {
-- double fMul = pOutput->GetStretch();
-- aTextSize.Width() = (long)(aTextSize.Width() / fMul + 0.5);
-- }
--
-- aTextSize.Height() = aMetric.GetAscent() + aMetric.GetDescent();
-- if ( GetOrient() != SVX_ORIENTATION_STANDARD )
-- {
-- long nTemp = aTextSize.Height();
-- aTextSize.Height() = aTextSize.Width();
-- aTextSize.Width() = nTemp;
-- }
--
-- nOriginalWidth = aTextSize.Width();
-- if ( bPixelToLogic )
-- aTextSize = pRefDevice->LogicToPixel( aTextSize );
-+ TextChanged();
- }
- // sonst String/Groesse behalten
- }
-@@ -508,6 +508,77 @@ void ScDrawStringsVars::SetHashText()
- SetAutoText( String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("###")) );
- }
-
-+void ScDrawStringsVars::SetTextToWidthOrHash( ScBaseCell* pCell, long nWidth )
-+{
-+ if (!pCell)
-+ return;
-+
-+ CellType eType = pCell->GetCellType();
-+ if (eType != CELLTYPE_VALUE && eType != CELLTYPE_FORMULA)
-+ // must be a value or formula cell.
-+ return;
-+
-+ if (eType == CELLTYPE_FORMULA && !static_cast<ScFormulaCell*>(pCell)->IsValue())
-+ // If it's formula, the result must be a value.
-+ return;
-+
-+ ULONG nFormat = GetValueFormat();
-+ if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
-+ {
-+ // Not 'General' number format. Set hash text and bail out.
-+ SetHashText();
-+ return;
-+ }
-+
-+ double fVal = (eType == CELLTYPE_VALUE) ?
-+ static_cast<ScValueCell*>(pCell)->GetValue() : static_cast<ScFormulaCell*>(pCell)->GetValue();
-+
-+ const SvNumberformat* pNumFormat = pOutput->pDoc->GetFormatTable()->GetEntry(nFormat);
-+ if (!pNumFormat)
-+ return;
-+
-+ long nMaxDigit = GetMaxDigitWidth();
-+ sal_uInt16 nNumDigits = static_cast<sal_uInt16>(nWidth / nMaxDigit);
-+
-+ if (!pNumFormat->GetOutputString(fVal, nNumDigits, aString))
-+ // Failed to get output string. Bail out.
-+ return;
-+
-+ sal_uInt8 nSignCount = 0, nDecimalCount = 0;
-+ xub_StrLen nLen = aString.Len();
-+ sal_Unicode cDecSep = ScGlobal::GetpLocaleData()->getLocaleItem().decimalSeparator.getStr()[0];
-+ for (xub_StrLen i = 0; i < nLen; ++i)
-+ {
-+ sal_Unicode c = aString.GetChar(i);
-+ if (c == sal_Unicode('-'))
-+ ++nSignCount;
-+ else if (c == cDecSep)
-+ ++nDecimalCount;
-+ }
-+ if (nDecimalCount)
-+ nWidth += (nMaxDigit - GetDotWidth()) * nDecimalCount;
-+ if (nSignCount)
-+ nWidth += (nMaxDigit - GetSignWidth()) * nSignCount;
-+
-+ if (nDecimalCount || nSignCount)
-+ {
-+ // Re-calculate.
-+ nNumDigits = static_cast<sal_uInt16>(nWidth / nMaxDigit);
-+ if (!pNumFormat->GetOutputString(fVal, nNumDigits, aString))
-+ // Failed to get output string. Bail out.
-+ return;
-+ }
-+
-+ if (pOutput->pFmtDevice->GetTextWidth(aString) > nWidth)
-+ {
-+ // Even after the decimal adjustment the text doesn't fit. Give up.
-+ SetHashText();
-+ return;
-+ }
-+
-+ TextChanged();
-+}
-+
- void ScDrawStringsVars::SetAutoText( const String& rAutoText )
- {
- aString = rAutoText;
-@@ -538,6 +609,66 @@ void ScDrawStringsVars::SetAutoText( const String& rAutoText )
- pLastCell = NULL; // derselbe Text kann in der naechsten Zelle wieder passen
- }
-
-+long ScDrawStringsVars::GetMaxDigitWidth()
-+{
-+ if (nMaxDigitWidth > 0)
-+ return nMaxDigitWidth;
-+
-+ sal_Char cZero = '0';
-+ for (int i = 0; i < 10; ++i)
-+ {
-+ sal_Char cDigit = cZero + i;
-+ long n = pOutput->pFmtDevice->GetTextWidth(String(cDigit));
-+ nMaxDigitWidth = ::std::max(nMaxDigitWidth, n);
-+ }
-+ return nMaxDigitWidth;
-+}
-+
-+long ScDrawStringsVars::GetSignWidth()
-+{
-+ if (nSignWidth > 0)
-+ return nSignWidth;
-+
-+ nSignWidth = pOutput->pFmtDevice->GetTextWidth(String('-'));
-+ return nSignWidth;
-+}
-+
-+long ScDrawStringsVars::GetDotWidth()
-+{
-+ if (nDotWidth > 0)
-+ return nDotWidth;
-+
-+ const ::rtl::OUString& sep = ScGlobal::GetpLocaleData()->getLocaleItem().decimalSeparator;
-+ nDotWidth = pOutput->pFmtDevice->GetTextWidth(sep);
-+ return nDotWidth;
-+}
-+
-+void ScDrawStringsVars::TextChanged()
-+{
-+ OutputDevice* pRefDevice = pOutput->pRefDevice;
-+ OutputDevice* pFmtDevice = pOutput->pFmtDevice;
-+ aTextSize.Width() = pFmtDevice->GetTextWidth( aString );
-+ aTextSize.Height() = pFmtDevice->GetTextHeight();
-+
-+ if ( !pRefDevice->GetConnectMetaFile() || pRefDevice->GetOutDevType() == OUTDEV_PRINTER )
-+ {
-+ double fMul = pOutput->GetStretch();
-+ aTextSize.Width() = (long)(aTextSize.Width() / fMul + 0.5);
-+ }
-+
-+ aTextSize.Height() = aMetric.GetAscent() + aMetric.GetDescent();
-+ if ( GetOrient() != SVX_ORIENTATION_STANDARD )
-+ {
-+ long nTemp = aTextSize.Height();
-+ aTextSize.Height() = aTextSize.Width();
-+ aTextSize.Width() = nTemp;
-+ }
-+
-+ nOriginalWidth = aTextSize.Width();
-+ if ( bPixelToLogic )
-+ aTextSize = pRefDevice->LogicToPixel( aTextSize );
-+}
-+
- BOOL ScDrawStringsVars::HasEditCharacters() const
- {
- static const sal_Unicode pChars[] =
-@@ -919,29 +1050,25 @@ BOOL ScOutputData::IsAvailable( SCCOL nX, SCROW nY )
- // bCellIsValue: if set, don't extend into empty cells
- // bBreak: if set, don't extend, and don't set clip marks (but rLeftClip/rRightClip is set)
- // bOverwrite: if set, also extend into non-empty cells (for rotated text)
--// rAlignRect: output: single or merged cell, used for alignment (visual rectangle)
--// rClipRect: output: total output area, for clipping (visual)
--// rLeftClip: output: need to clip at rClipRect left (visual) edge
--// rRightClip: output: same for right
-+// rParam output: various area parameters.
-
- void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY,
-- SCCOL nCellX, SCROW nCellY, long nNeeded,
-- const ScPatternAttr& rPattern,
-- USHORT nHorJustify, BOOL bCellIsValue,
-- BOOL bBreak, BOOL bOverwrite,
-- Rectangle& rAlignRect, Rectangle& rClipRect,
-- BOOL& rLeftClip, BOOL& rRightClip )
-+ SCCOL nCellX, SCROW nCellY, long nNeeded,
-+ const ScPatternAttr& rPattern,
-+ USHORT nHorJustify, bool bCellIsValue,
-+ bool bBreak, bool bOverwrite,
-+ OutputAreaParam& rParam )
- {
-- // rThisRowInfo may be for a different row than nCellY, is still used for clip marks
-+ // rThisRowInfo may be for a different row than nCellY, is still used for clip marks
- RowInfo& rThisRowInfo = pRowInfo[nArrY];
-
- long nLayoutSign = bLayoutRTL ? -1 : 1;
-
-- long nCellPosX = nPosX; // find nCellX position, starting at nX/nPosX
-+ long nCellPosX = nPosX; // find nCellX position, starting at nX/nPosX
- SCCOL nCompCol = nX;
- while ( nCellX > nCompCol )
- {
-- //! extra member function for width?
-+ //! extra member function for width?
- long nColWidth = ( nCompCol <= nX2 ) ?
- pRowInfo[0].pCellInfo[nCompCol+1].nWidth :
- (long) ( pDoc->GetColWidth( nCompCol, nTab ) * nPPTX );
-@@ -957,7 +1084,7 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
- nCellPosX -= nColWidth * nLayoutSign;
- }
-
-- long nCellPosY = nPosY; // find nCellY position, starting at nArrY/nPosY
-+ long nCellPosY = nPosY; // find nCellY position, starting at nArrY/nPosY
- SCSIZE nCompArr = nArrY;
- SCROW nCompRow = pRowInfo[nCompArr].nRowNo;
- while ( nCellY > nCompRow )
-@@ -1002,28 +1129,30 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
- {
- // take first row's height from row info
- nMergeSizeY += rThisRowInfo.nHeight;
-- nDirect = 1; // skip in loop
-+ nDirect = 1; // skip in loop
- }
- // following rows always from document
- nMergeSizeY += (long) pDoc->GetScaledRowHeight( nCellY+nDirect, nCellY+nMergeRows-1, nTab, nPPTY);
-
-- --nMergeSizeX; // leave out the grid horizontally, also for alignment (align between grid lines)
-+ --nMergeSizeX; // leave out the grid horizontally, also for alignment (align between grid lines)
-+
-+ rParam.mnColWidth = nMergeSizeX; // store the actual column width.
-
- //
- // construct the rectangles using logical left/right values (justify is called at the end)
- //
-
-- // rAlignRect is the single cell or merged area, used for alignment.
-+ // rAlignRect is the single cell or merged area, used for alignment.
-
-- rAlignRect.Left() = nCellPosX;
-- rAlignRect.Right() = nCellPosX + ( nMergeSizeX - 1 ) * nLayoutSign;
-- rAlignRect.Top() = nCellPosY;
-- rAlignRect.Bottom() = nCellPosY + nMergeSizeY - 1;
-+ rParam.maAlignRect.Left() = nCellPosX;
-+ rParam.maAlignRect.Right() = nCellPosX + ( nMergeSizeX - 1 ) * nLayoutSign;
-+ rParam.maAlignRect.Top() = nCellPosY;
-+ rParam.maAlignRect.Bottom() = nCellPosY + nMergeSizeY - 1;
-
-- // rClipRect is all cells that are used for output.
-- // For merged cells this is the same as rAlignRect, otherwise neighboring cells can also be used.
-+ // rClipRect is all cells that are used for output.
-+ // For merged cells this is the same as rAlignRect, otherwise neighboring cells can also be used.
-
-- rClipRect = rAlignRect;
-+ rParam.maClipRect = rParam.maAlignRect;
- if ( nNeeded > nMergeSizeX )
- {
- SvxCellHorJustify eHorJust = (SvxCellHorJustify)nHorJustify;
-@@ -1057,14 +1186,14 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
- SCCOL nLeftX = nCellX;
- if ( !bMerged && !bCellIsValue && !bBreak )
- {
-- // look for empty cells into which the text can be extended
-+ // look for empty cells into which the text can be extended
-
- while ( nRightMissing > 0 && nRightX < MAXCOL && ( bOverwrite || IsAvailable( nRightX+1, nCellY ) ) )
- {
- ++nRightX;
- long nAdd = (long) ( pDoc->GetColWidth( nRightX, nTab ) * nPPTX );
- nRightMissing -= nAdd;
-- rClipRect.Right() += nAdd * nLayoutSign;
-+ rParam.maClipRect.Right() += nAdd * nLayoutSign;
-
- if ( rThisRowInfo.nRowNo == nCellY && nRightX >= nX1 && nRightX <= nX2 )
- rThisRowInfo.pCellInfo[nRightX].bHideGrid = TRUE;
-@@ -1078,33 +1207,33 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
- --nLeftX;
- long nAdd = (long) ( pDoc->GetColWidth( nLeftX, nTab ) * nPPTX );
- nLeftMissing -= nAdd;
-- rClipRect.Left() -= nAdd * nLayoutSign;
-+ rParam.maClipRect.Left() -= nAdd * nLayoutSign;
- }
- }
-
-- // Set flag and reserve space for clipping mark triangle,
-- // even if rThisRowInfo isn't for nCellY (merged cells).
-+ // Set flag and reserve space for clipping mark triangle,
-+ // even if rThisRowInfo isn't for nCellY (merged cells).
- if ( nRightMissing > 0 && bMarkClipped && nRightX >= nX1 && nRightX <= nX2 && !bBreak && !bCellIsValue )
- {
- rThisRowInfo.pCellInfo[nRightX+1].nClipMark |= SC_CLIPMARK_RIGHT;
- bAnyClipped = TRUE;
- long nMarkPixel = (long)( SC_CLIPMARK_SIZE * nPPTX );
-- rClipRect.Right() -= nMarkPixel * nLayoutSign;
-+ rParam.maClipRect.Right() -= nMarkPixel * nLayoutSign;
- }
- if ( nLeftMissing > 0 && bMarkClipped && nLeftX >= nX1 && nLeftX <= nX2 && !bBreak && !bCellIsValue )
- {
- rThisRowInfo.pCellInfo[nLeftX+1].nClipMark |= SC_CLIPMARK_LEFT;
- bAnyClipped = TRUE;
- long nMarkPixel = (long)( SC_CLIPMARK_SIZE * nPPTX );
-- rClipRect.Left() += nMarkPixel * nLayoutSign;
-+ rParam.maClipRect.Left() += nMarkPixel * nLayoutSign;
- }
-
-- rLeftClip = ( nLeftMissing > 0 );
-- rRightClip = ( nRightMissing > 0 );
-+ rParam.mbLeftClip = ( nLeftMissing > 0 );
-+ rParam.mbRightClip = ( nRightMissing > 0 );
- }
- else
- {
-- rLeftClip = rRightClip = FALSE;
-+ rParam.mbLeftClip = rParam.mbRightClip = FALSE;
-
- // leave space for AutoFilter on screen
- // (for automatic line break: only if not formatting for printer, as in ScColumn::GetNeededSize)
-@@ -1120,30 +1249,30 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
- // content fits even in the remaining area without the filter button
- // -> align within that remaining area
-
-- rAlignRect.Right() -= nFilter * nLayoutSign;
-- rClipRect.Right() -= nFilter * nLayoutSign;
-+ rParam.maAlignRect.Right() -= nFilter * nLayoutSign;
-+ rParam.maClipRect.Right() -= nFilter * nLayoutSign;
-
- // if a number doesn't fit, don't hide part of the number behind the button
- // -> set clip flags, so "###" replacement is used (but also within the smaller area)
-
- if ( !bFit )
-- rLeftClip = rRightClip = TRUE;
-+ rParam.mbLeftClip = rParam.mbRightClip = TRUE;
- }
- }
- }
-
-- // justify both rectangles for alignment calculation, use with DrawText etc.
-+ // justify both rectangles for alignment calculation, use with DrawText etc.
-
-- rAlignRect.Justify();
-- rClipRect.Justify();
-+ rParam.maAlignRect.Justify();
-+ rParam.maClipRect.Justify();
-
- #if 0
- //! Test !!!
- pDev->Push();
- pDev->SetLineColor();
- pDev->SetFillColor( COL_LIGHTGREEN );
-- pDev->DrawRect( pDev->PixelToLogic(rClipRect) );
-- pDev->DrawRect( rClipRect ); // print preview
-+ pDev->DrawRect( pDev->PixelToLogic(rParam.maClipRect) );
-+ pDev->DrawRect( rParam.maClipRect ); // print preview
- pDev->Pop();
- //! Test !!!
- #endif
-@@ -1184,12 +1313,9 @@ void ScOutputData::DrawStrings( BOOL bPixelToLogic )
- --nLoopStartX; // start before nX1 for rest of long text to the left
-
- // variables for GetOutputArea
-+ OutputAreaParam aAreaParam;
- BOOL bCellIsValue = FALSE;
-- BOOL bLeftClip = FALSE;
-- BOOL bRightClip = FALSE;
- long nNeededWidth = 0;
-- Rectangle aAlignRect;
-- Rectangle aClipRect;
- SvxCellHorJustify eOutHorJust = SVX_HOR_JUSTIFY_STANDARD;
- const ScPatternAttr* pPattern = NULL;
- const SfxItemSet* pCondSet = NULL;
-@@ -1360,6 +1486,7 @@ void ScOutputData::DrawStrings( BOOL bPixelToLogic )
- bNeedEdit = aVars.HasEditCharacters() ||
- (bFormulaCell && ((ScFormulaCell*)pCell)->IsMultilineResult());
- }
-+ long nTotalMargin = 0;
- if (bDoCell && !bNeedEdit)
- {
- CellType eCellType = pCell->GetCellType();
-@@ -1381,14 +1508,17 @@ void ScOutputData::DrawStrings( BOOL bPixelToLogic )
- BOOL bRepeat = aVars.IsRepeat() && !bBreak;
- BOOL bShrink = aVars.IsShrink() && !bBreak && !bRepeat;
-
-- long nTotalMargin = (long) ( aVars.GetLeftTotal() * nPPTX ) +
-- (long) ( aVars.GetMargin()->GetRightMargin() * nPPTX );
-+ nTotalMargin =
-+ static_cast<long>(aVars.GetLeftTotal() * nPPTX) +
-+ static_cast<long>(aVars.GetMargin()->GetRightMargin() * nPPTX);
-+
- nNeededWidth = aVars.GetTextSize().Width() + nTotalMargin;
-+
- // GetOutputArea gives justfied rectangles
- GetOutputArea( nX, nArrY, nPosX, nPosY, nCellX, nCellY, nNeededWidth,
-- *pPattern, sal::static_int_cast<USHORT>(eOutHorJust),
-- bCellIsValue || bRepeat || bShrink, bBreak, FALSE,
-- aAlignRect, aClipRect, bLeftClip, bRightClip );
-+ *pPattern, sal::static_int_cast<USHORT>(eOutHorJust),
-+ bCellIsValue || bRepeat || bShrink, bBreak, FALSE,
-+ aAreaParam );
-
- if ( bShrink )
- {
-@@ -1398,9 +1528,9 @@ void ScOutputData::DrawStrings( BOOL bPixelToLogic )
- // DrawEdit is used to vertically scale 90 deg rotated text.
- bNeedEdit = TRUE;
- }
-- else if ( bLeftClip || bRightClip ) // horizontal
-+ else if ( aAreaParam.mbLeftClip || aAreaParam.mbRightClip ) // horizontal
- {
-- long nAvailable = aAlignRect.GetWidth() - nTotalMargin;
-+ long nAvailable = aAreaParam.maAlignRect.GetWidth() - nTotalMargin;
- long nScaleSize = aVars.GetTextSize().Width(); // without margin
-
- if ( nScaleSize > 0 ) // 0 if the text is empty (formulas, number formats)
-@@ -1424,16 +1554,16 @@ void ScOutputData::DrawStrings( BOOL bPixelToLogic )
- // If even at half the size the font still isn't rendered smaller,
- // fall back to normal clipping (showing ### for numbers).
- if ( nNewSize <= nAvailable )
-- bLeftClip = bRightClip = FALSE;
-+ aAreaParam.mbLeftClip = aAreaParam.mbRightClip = FALSE;
-
- pOldPattern = NULL;
- }
- }
- }
-
-- if ( bRepeat && !bLeftClip && !bRightClip )
-+ if ( bRepeat && !aAreaParam.mbLeftClip && !aAreaParam.mbRightClip )
- {
-- long nAvailable = aAlignRect.GetWidth() - nTotalMargin;
-+ long nAvailable = aAreaParam.maAlignRect.GetWidth() - nTotalMargin;
- long nRepeatSize = aVars.GetTextSize().Width(); // without margin
- // When formatting for the printer, the text sizes don't always add up.
- // Round down (too few repetitions) rather than exceeding the cell size then:
-@@ -1457,13 +1587,13 @@ void ScOutputData::DrawStrings( BOOL bPixelToLogic )
- if ( bBreak )
- {
- if ( aVars.GetOrient() == SVX_ORIENTATION_STANDARD )
-- bNeedEdit = ( bLeftClip || bRightClip );
-+ bNeedEdit = ( aAreaParam.mbLeftClip || aAreaParam.mbRightClip );
- else
- {
- long nHeight = aVars.GetTextSize().Height() +
- (long)(aVars.GetMargin()->GetTopMargin()*nPPTY) +
- (long)(aVars.GetMargin()->GetBottomMargin()*nPPTY);
-- bNeedEdit = ( nHeight > aClipRect.GetHeight() );
-+ bNeedEdit = ( nHeight > aAreaParam.maClipRect.GetHeight() );
- }
- }
- }
-@@ -1479,48 +1609,49 @@ void ScOutputData::DrawStrings( BOOL bPixelToLogic )
- }
- if ( bDoCell )
- {
-- if ( bCellIsValue && ( bLeftClip || bRightClip ) )
-+ if ( bCellIsValue && ( aAreaParam.mbLeftClip || aAreaParam.mbRightClip ) )
- {
-- aVars.SetHashText();
-+ // Adjust the decimals to fit the available column width.
-+ aVars.SetTextToWidthOrHash(pCell, aAreaParam.mnColWidth - nTotalMargin);
- nNeededWidth = aVars.GetTextSize().Width() +
- (long) ( aVars.GetLeftTotal() * nPPTX ) +
- (long) ( aVars.GetMargin()->GetRightMargin() * nPPTX );
-- if ( nNeededWidth <= aClipRect.GetWidth() )
-- bLeftClip = bRightClip = FALSE;
-+ if ( nNeededWidth <= aAreaParam.maClipRect.GetWidth() )
-+ aAreaParam.mbLeftClip = aAreaParam.mbRightClip = FALSE;
-
- // If the "###" replacement doesn't fit into the cells, no clip marks
- // are shown, as the "###" already denotes too little space.
- // The rectangles from the first GetOutputArea call remain valid.
- }
-
-- long nJustPosX = aAlignRect.Left(); // "justified" - effect of alignment will be added
-- long nJustPosY = aAlignRect.Top();
-- long nAvailWidth = aAlignRect.GetWidth();
-- long nOutHeight = aAlignRect.GetHeight();
-+ long nJustPosX = aAreaParam.maAlignRect.Left(); // "justified" - effect of alignment will be added
-+ long nJustPosY = aAreaParam.maAlignRect.Top();
-+ long nAvailWidth = aAreaParam.maAlignRect.GetWidth();
-+ long nOutHeight = aAreaParam.maAlignRect.GetHeight();
-
-- BOOL bOutside = ( aClipRect.Right() < nScrX || aClipRect.Left() >= nScrX + nScrW );
-- if ( aClipRect.Left() < nScrX )
-+ BOOL bOutside = ( aAreaParam.maClipRect.Right() < nScrX || aAreaParam.maClipRect.Left() >= nScrX + nScrW );
-+ if ( aAreaParam.maClipRect.Left() < nScrX )
- {
-- aClipRect.Left() = nScrX;
-- bLeftClip = TRUE;
-+ aAreaParam.maClipRect.Left() = nScrX;
-+ aAreaParam.mbLeftClip = TRUE;
- }
-- if ( aClipRect.Right() > nScrX + nScrW )
-+ if ( aAreaParam.maClipRect.Right() > nScrX + nScrW )
- {
-- aClipRect.Right() = nScrX + nScrW; //! minus one?
-- bRightClip = TRUE;
-+ aAreaParam.maClipRect.Right() = nScrX + nScrW; //! minus one?
-+ aAreaParam.mbRightClip = TRUE;
- }
-
-- BOOL bHClip = bLeftClip || bRightClip;
-+ BOOL bHClip = aAreaParam.mbLeftClip || aAreaParam.mbRightClip;
- BOOL bVClip = FALSE;
-
-- if ( aClipRect.Top() < nScrY )
-+ if ( aAreaParam.maClipRect.Top() < nScrY )
- {
-- aClipRect.Top() = nScrY;
-+ aAreaParam.maClipRect.Top() = nScrY;
- bVClip = TRUE;
- }
-- if ( aClipRect.Bottom() > nScrY + nScrH )
-+ if ( aAreaParam.maClipRect.Bottom() > nScrY + nScrH )
- {
-- aClipRect.Bottom() = nScrY + nScrH; //! minus one?
-+ aAreaParam.maClipRect.Bottom() = nScrY + nScrH; //! minus one?
- bVClip = TRUE;
- }
-
-@@ -1603,27 +1734,27 @@ void ScOutputData::DrawStrings( BOOL bPixelToLogic )
-
- if (!bHClip)
- {
-- aClipRect.Left() = nScrX;
-- aClipRect.Right() = nScrX+nScrW;
-+ aAreaParam.maClipRect.Left() = nScrX;
-+ aAreaParam.maClipRect.Right() = nScrX+nScrW;
- }
- if (!bVClip)
- {
-- aClipRect.Top() = nScrY;
-- aClipRect.Bottom() = nScrY+nScrH;
-+ aAreaParam.maClipRect.Top() = nScrY;
-+ aAreaParam.maClipRect.Bottom() = nScrY+nScrH;
- }
-
- // aClipRect is not used after SetClipRegion/IntersectClipRegion,
- // so it can be modified here
- if (bPixelToLogic)
-- aClipRect = pRefDevice->PixelToLogic( aClipRect );
-+ aAreaParam.maClipRect = pRefDevice->PixelToLogic( aAreaParam.maClipRect );
-
- if (bMetaFile)
- {
- pDev->Push();
-- pDev->IntersectClipRegion( aClipRect );
-+ pDev->IntersectClipRegion( aAreaParam.maClipRect );
- }
- else
-- pDev->SetClipRegion( Region( aClipRect ) );
-+ pDev->SetClipRegion( Region( aAreaParam.maClipRect ) );
- }
-
- Point aURLStart( nJustPosX, nJustPosY ); // copy before modifying for orientation
-@@ -1827,7 +1958,7 @@ long lcl_GetEditSize( EditEngine& rEngine, BOOL bWidth, BOOL bSwap, long nAttrRo
- void ScOutputData::ShrinkEditEngine( EditEngine& rEngine, const Rectangle& rAlignRect,
- long nLeftM, long nTopM, long nRightM, long nBottomM,
- BOOL bWidth, USHORT nOrient, long nAttrRotate, BOOL bPixelToLogic,
-- long& rEngineWidth, long& rEngineHeight, long& rNeededPixel, BOOL& rLeftClip, BOOL& rRightClip )
-+ long& rEngineWidth, long& rEngineHeight, long& rNeededPixel, bool& rLeftClip, bool& rRightClip )
- {
- if ( !bWidth )
- {
-@@ -2149,10 +2280,7 @@ void ScOutputData::DrawEdit(BOOL bPixelToLogic)
- nPosY = nScrY;
- }
-
-- Rectangle aAlignRect;
-- Rectangle aClipRect;
-- BOOL bLeftClip = FALSE;
-- BOOL bRightClip = FALSE;
-+ OutputAreaParam aAreaParam;
-
- //
- // Initial page size - large for normal text, cell size for automatic line breaks
-@@ -2167,23 +2295,22 @@ void ScOutputData::DrawEdit(BOOL bPixelToLogic)
-
- //! handle nArrY == 0
- GetOutputArea( nXForPos, nArrYForPos, nPosX, nPosY, nCellX, nCellY, 0,
-- *pPattern, sal::static_int_cast<USHORT>(eOutHorJust),
-- bCellIsValue, TRUE, FALSE,
-- aAlignRect, aClipRect, bLeftClip, bRightClip );
-+ *pPattern, sal::static_int_cast<USHORT>(eOutHorJust),
-+ bCellIsValue, true, false, aAreaParam );
-
- //! special ScEditUtil handling if formatting for printer
-
- if ( eOrient == SVX_ORIENTATION_TOPBOTTOM || eOrient == SVX_ORIENTATION_BOTTOMTOP )
-- aPaperSize.Width() = aAlignRect.GetHeight() - nTopM - nBottomM;
-+ aPaperSize.Width() = aAreaParam.maAlignRect.GetHeight() - nTopM - nBottomM;
- else
-- aPaperSize.Width() = aAlignRect.GetWidth() - nLeftM - nRightM;
-+ aPaperSize.Width() = aAreaParam.maAlignRect.GetWidth() - nLeftM - nRightM;
-
- if (bAsianVertical && bBreak)
- {
- // add some extra height (default margin value) for safety
- // as long as GetEditArea isn't used below
- long nExtraHeight = (long)( 20 * nPPTY );
-- aPaperSize.Height() = aAlignRect.GetHeight() - nTopM - nBottomM + nExtraHeight;
-+ aPaperSize.Height() = aAreaParam.maAlignRect.GetHeight() - nTopM - nBottomM + nExtraHeight;
- }
- }
- if (bPixelToLogic)
-@@ -2372,26 +2499,26 @@ void ScOutputData::DrawEdit(BOOL bPixelToLogic)
- {
- // for break, the first GetOutputArea call is sufficient
- GetOutputArea( nXForPos, nArrYForPos, nPosX, nPosY, nCellX, nCellY, nNeededPixel,
-- *pPattern, sal::static_int_cast<USHORT>(eOutHorJust),
-- bCellIsValue || bRepeat || bShrink, FALSE, FALSE,
-- aAlignRect, aClipRect, bLeftClip, bRightClip );
-+ *pPattern, sal::static_int_cast<USHORT>(eOutHorJust),
-+ bCellIsValue || bRepeat || bShrink, false, false, aAreaParam );
-
- if ( bShrink )
- {
- BOOL bWidth = ( eOrient == SVX_ORIENTATION_STANDARD && !bAsianVertical );
-- ShrinkEditEngine( *pEngine, aAlignRect,
-+ ShrinkEditEngine( *pEngine, aAreaParam.maAlignRect,
- nLeftM, nTopM, nRightM, nBottomM, bWidth,
- sal::static_int_cast<USHORT>(eOrient), 0, bPixelToLogic,
-- nEngineWidth, nEngineHeight, nNeededPixel, bLeftClip, bRightClip );
-+ nEngineWidth, nEngineHeight, nNeededPixel,
-+ aAreaParam.mbLeftClip, aAreaParam.mbRightClip );
- }
-
-- if ( bRepeat && !bLeftClip && !bRightClip && pEngine->GetParagraphCount() == 1 )
-+ if ( bRepeat && !aAreaParam.mbLeftClip && !aAreaParam.mbRightClip && pEngine->GetParagraphCount() == 1 )
- {
- // First check if twice the space for the formatted text is available
- // (otherwise just keep it unchanged).
-
- long nFormatted = nNeededPixel - nLeftM - nRightM; // without margin
-- long nAvailable = aAlignRect.GetWidth() - nLeftM - nRightM;
-+ long nAvailable = aAreaParam.maAlignRect.GetWidth() - nLeftM - nRightM;
- if ( nAvailable >= 2 * nFormatted )
- {
- // "repeat" is handled with unformatted text (for performance reasons)
-@@ -2425,7 +2552,7 @@ void ScOutputData::DrawEdit(BOOL bPixelToLogic)
- }
- }
-
-- if ( bCellIsValue && ( bLeftClip || bRightClip ) )
-+ if ( bCellIsValue && ( aAreaParam.mbLeftClip || aAreaParam.mbRightClip ) )
- {
- pEngine->SetText( String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("###")) );
- nEngineWidth = (long) pEngine->CalcTextWidth();
-@@ -2448,11 +2575,11 @@ void ScOutputData::DrawEdit(BOOL bPixelToLogic)
- }
- }
-
-- long nStartX = aAlignRect.Left();
-- long nStartY = aAlignRect.Top();
-- long nCellWidth = aAlignRect.GetWidth();
-+ long nStartX = aAreaParam.maAlignRect.Left();
-+ long nStartY = aAreaParam.maAlignRect.Top();
-+ long nCellWidth = aAreaParam.maAlignRect.GetWidth();
- long nOutWidth = nCellWidth - 1 - nLeftM - nRightM;
-- long nOutHeight = aAlignRect.GetHeight() - nTopM - nBottomM;
-+ long nOutHeight = aAreaParam.maAlignRect.GetHeight() - nTopM - nBottomM;
-
- if ( bBreak || eOrient != SVX_ORIENTATION_STANDARD || bAsianVertical )
- {
-@@ -2472,21 +2599,21 @@ void ScOutputData::DrawEdit(BOOL bPixelToLogic)
- nStartX += nLeftM;
- }
-
-- BOOL bOutside = ( aClipRect.Right() < nScrX || aClipRect.Left() >= nScrX + nScrW );
-- if ( aClipRect.Left() < nScrX )
-+ BOOL bOutside = ( aAreaParam.maClipRect.Right() < nScrX || aAreaParam.maClipRect.Left() >= nScrX + nScrW );
-+ if ( aAreaParam.maClipRect.Left() < nScrX )
- {
-- aClipRect.Left() = nScrX;
-- bLeftClip = TRUE;
-+ aAreaParam.maClipRect.Left() = nScrX;
-+ aAreaParam.mbLeftClip = true;
- }
-- if ( aClipRect.Right() > nScrX + nScrW )
-+ if ( aAreaParam.maClipRect.Right() > nScrX + nScrW )
- {
-- aClipRect.Right() = nScrX + nScrW; //! minus one?
-- bRightClip = TRUE;
-+ aAreaParam.maClipRect.Right() = nScrX + nScrW; //! minus one?
-+ aAreaParam.mbRightClip = true;
- }
-
- if ( !bHidden && !bOutside )
- {
-- BOOL bClip = bLeftClip || bRightClip;
-+ bool bClip = aAreaParam.mbLeftClip || aAreaParam.mbRightClip;
- BOOL bSimClip = FALSE;
-
- if ( bWrapFields )
-@@ -2495,14 +2622,14 @@ void ScOutputData::DrawEdit(BOOL bPixelToLogic)
- bClip = TRUE;
- }
-
-- if ( aClipRect.Top() < nScrY )
-+ if ( aAreaParam.maClipRect.Top() < nScrY )
- {
-- aClipRect.Top() = nScrY;
-+ aAreaParam.maClipRect.Top() = nScrY;
- bClip = TRUE;
- }
-- if ( aClipRect.Bottom() > nScrY + nScrH )
-+ if ( aAreaParam.maClipRect.Bottom() > nScrY + nScrH )
- {
-- aClipRect.Bottom() = nScrY + nScrH; //! minus one?
-+ aAreaParam.maClipRect.Bottom() = nScrY + nScrH; //! minus one?
- bClip = TRUE;
- }
-
-@@ -2554,8 +2681,8 @@ void ScOutputData::DrawEdit(BOOL bPixelToLogic)
- bAnyClipped = TRUE;
-
- long nMarkPixel = (long)( SC_CLIPMARK_SIZE * nPPTX );
-- if ( aClipRect.Right() - nMarkPixel > aClipRect.Left() )
-- aClipRect.Right() -= nMarkPixel;
-+ if ( aAreaParam.maClipRect.Right() - nMarkPixel > aAreaParam.maClipRect.Left() )
-+ aAreaParam.maClipRect.Right() -= nMarkPixel;
- }
- }
-
-@@ -2579,9 +2706,9 @@ void ScOutputData::DrawEdit(BOOL bPixelToLogic)
- // Clip marks are already handled in GetOutputArea
-
- if (bPixelToLogic)
-- aLogicClip = pRefDevice->PixelToLogic( aClipRect );
-+ aLogicClip = pRefDevice->PixelToLogic( aAreaParam.maClipRect );
- else
-- aLogicClip = aClipRect;
-+ aLogicClip = aAreaParam.maClipRect;
-
- if (bClip) // bei bSimClip nur aClipRect initialisieren
- {
-@@ -3215,10 +3342,7 @@ void ScOutputData::DrawRotated(BOOL bPixelToLogic)
-
- // use GetOutputArea to hide the grid
- // (clip region is done manually below)
-- BOOL bLeftClip = FALSE;
-- BOOL bRightClip = FALSE;
-- Rectangle aAlignRect;
-- Rectangle aClipRect;
-+ OutputAreaParam aAreaParam;
-
- SCCOL nCellX = nX;
- SCROW nCellY = nY;
-@@ -3231,8 +3355,7 @@ void ScOutputData::DrawRotated(BOOL bPixelToLogic)
-
- GetOutputArea( nX, nArrY, nCellStartX, nPosY, nCellX, nCellY, nNeededWidth,
- *pPattern, sal::static_int_cast<USHORT>(eOutHorJust),
-- FALSE, FALSE, TRUE,
-- aAlignRect, aClipRect, bLeftClip, bRightClip );
-+ FALSE, FALSE, TRUE, aAreaParam );
-
- if ( bShrink )
- {
-@@ -3240,19 +3363,19 @@ void ScOutputData::DrawRotated(BOOL bPixelToLogic)
- pRefDevice->LogicToPixel(Size(nEngineWidth,0)).Width() : nEngineWidth;
- long nNeededPixel = nPixelWidth + nLeftM + nRightM;
-
-- bLeftClip = bRightClip = TRUE;
-+ aAreaParam.mbLeftClip = aAreaParam.mbRightClip = TRUE;
-
- // always do height
-- ShrinkEditEngine( *pEngine, aAlignRect, nLeftM, nTopM, nRightM, nBottomM,
-+ ShrinkEditEngine( *pEngine, aAreaParam.maAlignRect, nLeftM, nTopM, nRightM, nBottomM,
- FALSE, sal::static_int_cast<USHORT>(eOrient), nAttrRotate, bPixelToLogic,
-- nEngineWidth, nEngineHeight, nNeededPixel, bLeftClip, bRightClip );
-+ nEngineWidth, nEngineHeight, nNeededPixel, aAreaParam.mbLeftClip, aAreaParam.mbRightClip );
-
- if ( eRotMode == SVX_ROTATE_MODE_STANDARD )
- {
- // do width only if rotating within the cell (standard mode)
-- ShrinkEditEngine( *pEngine, aAlignRect, nLeftM, nTopM, nRightM, nBottomM,
-+ ShrinkEditEngine( *pEngine, aAreaParam.maAlignRect, nLeftM, nTopM, nRightM, nBottomM,
- TRUE, sal::static_int_cast<USHORT>(eOrient), nAttrRotate, bPixelToLogic,
-- nEngineWidth, nEngineHeight, nNeededPixel, bLeftClip, bRightClip );
-+ nEngineWidth, nEngineHeight, nNeededPixel, aAreaParam.mbLeftClip, aAreaParam.mbRightClip );
- }
-
- // nEngineWidth/nEngineHeight is updated in ShrinkEditEngine
-@@ -3306,19 +3429,19 @@ void ScOutputData::DrawRotated(BOOL bPixelToLogic)
- }
-
- if (bPixelToLogic)
-- aClipRect = pRefDevice->PixelToLogic( Rectangle(
-+ aAreaParam.maClipRect = pRefDevice->PixelToLogic( Rectangle(
- Point(nClipStartX,nClipStartY), aClipSize ) );
- else
-- aClipRect = Rectangle(Point(nClipStartX, nClipStartY),
-+ aAreaParam.maClipRect = Rectangle(Point(nClipStartX, nClipStartY),
- aClipSize ); // Scale = 1
-
- if (bMetaFile)
- {
- pDev->Push();
-- pDev->IntersectClipRegion( aClipRect );
-+ pDev->IntersectClipRegion( aAreaParam.maClipRect );
- }
- else
-- pDev->SetClipRegion( Region( aClipRect ) );
-+ pDev->SetClipRegion( Region( aAreaParam.maClipRect ) );
- }
-
- Point aLogicStart;
---
-1.7.0.1
-
diff --git a/patches/dev300/calc-general-type-auto-decimal-svtools.diff b/patches/dev300/calc-general-type-auto-decimal-svtools.diff
deleted file mode 100644
index 7135131..0000000
--- a/patches/dev300/calc-general-type-auto-decimal-svtools.diff
+++ /dev/null
@@ -1,452 +0,0 @@
-From 05bde73affede0629ceefb84906d4a542701b54e Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 16:56:23 +0200
-Subject: [PATCH 180/768] calc-general-type-auto-decimal-svtools.diff
-
----
- svl/inc/svl/zforlist.hxx | 14 +++-
- svl/inc/svl/zformat.hxx | 7 ++
- svl/source/numbers/zforlist.cxx | 22 +++--
- svl/source/numbers/zformat.cxx | 180 +++++++++++++++++++++++++++++++-------
- svl/source/numbers/zforscan.cxx | 3 +-
- svl/source/numbers/zforscan.hxx | 8 +-
- 6 files changed, 184 insertions(+), 50 deletions(-)
-
-diff --git svl/inc/svl/zforlist.hxx svl/inc/svl/zforlist.hxx
-index 38cb4e3..dcf7041 100644
---- svl/inc/svl/zforlist.hxx
-+++ svl/inc/svl/zforlist.hxx
-@@ -333,6 +333,17 @@ class SvNumberFormatterRegistry_Impl;
- class SVL_DLLPUBLIC SvNumberFormatter
- {
- public:
-+ /**
-+ * We can't technically have an "infinite" value, so we use an arbitrary
-+ * upper precision threshold to represent the "unlimited" precision.
-+ */
-+ static const sal_uInt16 UNLIMITED_PRECISION;
-+
-+ /**
-+ * Precision suitable for numbers displayed in input bar, for instance
-+ * Calc's formula input bar.
-+ */
-+ static const sal_uInt16 INPUTSTRING_PRECISION;
-
- /// Preferred ctor with service manager and language/country enum
- SvNumberFormatter(
-@@ -579,11 +590,10 @@ public:
-
- /// Whether nFIndex is a special builtin format
- BOOL IsSpecialStandardFormat( sal_uInt32 nFIndex, LanguageType eLnge );
--
- /// Return the reference date
- Date* GetNullDate();
- /// Return the standard decimal precision
-- short GetStandardPrec();
-+ sal_uInt16 GetStandardPrec();
- /// Return whether zero suppression is switched on
- BOOL GetNoZero() { return bNoZero; }
- /** Get the type of a format (or NUMBERFORMAT_UNDEFINED if no entry),
-diff --git svl/inc/svl/zformat.hxx svl/inc/svl/zformat.hxx
-index 6fc031b..afc34b3 100644
---- svl/inc/svl/zformat.hxx
-+++ svl/inc/svl/zformat.hxx
-@@ -236,6 +236,12 @@ public:
- // in fact that could be any string used in number formats.
- static void LoadString( SvStream& rStream, String& rStr );
-
-+ /**
-+ * Get output string from a numeric value that fits the number of
-+ * characters specified.
-+ */
-+ bool GetOutputString( double fNumber, sal_uInt16 nCharCount, String& rOutString ) const;
-+
- BOOL GetOutputString( double fNumber, String& OutString, Color** ppColor );
- BOOL GetOutputString( String& sString, String& OutString, Color** ppColor );
-
-@@ -487,6 +493,7 @@ private:
-
- // standard number output
- SVL_DLLPRIVATE void ImpGetOutputStandard( double& fNumber, String& OutString );
-+ SVT_DLLPRIVATE void ImpGetOutputStdToPrecision( double& rNumber, String& rOutString, sal_uInt16 nPrecision ) const;
- // numbers in input line
- SVL_DLLPRIVATE void ImpGetOutputInputLine( double fNumber, String& OutString );
-
-diff --git svl/source/numbers/zforlist.cxx svl/source/numbers/zforlist.cxx
-index 55a376b..729b0c1 100644
---- svl/source/numbers/zforlist.cxx
-+++ svl/source/numbers/zforlist.cxx
-@@ -61,6 +61,7 @@
- #include <rtl/instance.hxx>
-
- #include <math.h>
-+#include <limits>
-
- using namespace ::com::sun::star;
- using namespace ::com::sun::star::uno;
-@@ -176,8 +177,12 @@ SV_IMPL_PTRARR( NfWSStringsDtor, String* );
- #define NF_BANKSYMBOL_FIX_POSITION 1
-
-
-+
- /***********************Funktionen SvNumberFormatter**************************/
-
-+const sal_uInt16 SvNumberFormatter::UNLIMITED_PRECISION = ::std::numeric_limits<sal_uInt16>::max();
-+const sal_uInt16 SvNumberFormatter::INPUTSTRING_PRECISION = ::std::numeric_limits<sal_uInt16>::max()-1;
-+
- SvNumberFormatter::SvNumberFormatter(
- const Reference< XMultiServiceFactory >& xSMgr,
- LanguageType eLang )
-@@ -338,11 +343,10 @@ void SvNumberFormatter::ChangeStandardPrec(short nPrec)
- pFormatScanner->ChangeStandardPrec(nPrec);
- }
-
--short SvNumberFormatter::GetStandardPrec()
-+sal_uInt16 SvNumberFormatter::GetStandardPrec()
- {
- return pFormatScanner->GetStandardPrec();
- }
--
- void SvNumberFormatter::ImpChangeSysCL( LanguageType eLnge, BOOL bLoadingSO5 )
- {
- if (eLnge == LANGUAGE_DONTKNOW)
-@@ -1473,7 +1477,6 @@ void SvNumberFormatter::GetInputLineString(const double& fOutNumber,
- String& sOutString)
- {
- SvNumberformat* pFormat;
-- short nOldPrec;
- Color* pColor;
- pFormat = (SvNumberformat*) aFTable.Get(nFIndex);
- if (!pFormat)
-@@ -1483,7 +1486,8 @@ void SvNumberFormatter::GetInputLineString(const double& fOutNumber,
- short eType = pFormat->GetType() & ~NUMBERFORMAT_DEFINED;
- if (eType == 0)
- eType = NUMBERFORMAT_DEFINED;
-- nOldPrec = -1;
-+ sal_uInt16 nOldPrec = pFormatScanner->GetStandardPrec();
-+ bool bPrecChanged = false;
- if (eType == NUMBERFORMAT_NUMBER || eType == NUMBERFORMAT_PERCENT
- || eType == NUMBERFORMAT_CURRENCY
- || eType == NUMBERFORMAT_SCIENTIFIC
-@@ -1491,8 +1495,8 @@ void SvNumberFormatter::GetInputLineString(const double& fOutNumber,
- {
- if (eType != NUMBERFORMAT_PERCENT) // spaeter Sonderbehandlung %
- eType = NUMBERFORMAT_NUMBER;
-- nOldPrec = pFormatScanner->GetStandardPrec();
-- ChangeStandardPrec(300); // Merkwert
-+ ChangeStandardPrec(INPUTSTRING_PRECISION);
-+ bPrecChanged = true;
- }
- sal_uInt32 nKey = nFIndex;
- switch ( eType )
-@@ -1512,12 +1516,12 @@ void SvNumberFormatter::GetInputLineString(const double& fOutNumber,
- {
- if ( eType == NUMBERFORMAT_TIME && pFormat->GetFormatPrecision() )
- {
-- nOldPrec = pFormatScanner->GetStandardPrec();
-- ChangeStandardPrec(300); // Merkwert
-+ ChangeStandardPrec(INPUTSTRING_PRECISION);
-+ bPrecChanged = true;
- }
... etc. - the rest is truncated
More information about the ooo-build-commit
mailing list