[ooo-build-commit] patches/dev300
Kohei Yoshida
kohei at kemper.freedesktop.org
Mon Jun 1 11:29:47 PDT 2009
patches/dev300/apply | 2
patches/dev300/calc-html-import-custom-lang-options.diff | 782 ---------------
patches/dev300/calc-html-import-custom-lang-sc-fix.diff | 41
patches/dev300/calc-html-import-custom-lang-sc.diff | 556 ++++++++--
4 files changed, 442 insertions(+), 939 deletions(-)
New commits:
commit 38b86ce3311a203b504b63b6f10a485dee73e480
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Jun 1 14:29:02 2009 -0400
Combined related patches.
* patches/dev300/apply:
* patches/dev300/calc-html-import-custom-lang-options.diff: removed.
* patches/dev300/calc-html-import-custom-lang-sc-fix.diff: removed.
* patches/dev300/calc-html-import-custom-lang-sc.diff: combined with the above
patches.
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 084ce6e..dbf2116 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -1953,8 +1953,6 @@ calc-autoinput-case-insensitive-matching.diff, n#472395, i#101046, kohei
# dependent number recognition.
calc-html-import-custom-lang-filter.diff, n#484272, kohei
calc-html-import-custom-lang-sc.diff, n#484272, kohei
-calc-html-import-custom-lang-options.diff, n#484272, kohei
-calc-html-import-custom-lang-sc-fix.diff, n#506095, kohei
# Don't duplicate merge flags when inserting a new row, to avoid merge flag
# corruption.
diff --git a/patches/dev300/calc-html-import-custom-lang-options.diff b/patches/dev300/calc-html-import-custom-lang-options.diff
deleted file mode 100644
index 53b07f1..0000000
--- a/patches/dev300/calc-html-import-custom-lang-options.diff
+++ /dev/null
@@ -1,782 +0,0 @@
-diff --git sc/inc/column.hxx sc/inc/column.hxx
-index 61286b6..0f9586e 100644
---- sc/inc/column.hxx
-+++ sc/inc/column.hxx
-@@ -244,7 +244,8 @@ public:
- // TRUE = Zahlformat gesetzt
- BOOL SetString( SCROW nRow, SCTAB nTab, const String& rString,
- formula::FormulaGrammar::AddressConvention conv = formula::FormulaGrammar::CONV_OOO,
-- SvNumberFormatter* pFormatter = NULL );
-+ SvNumberFormatter* pFormatter = NULL,
-+ bool bDetectNumberFormat = true );
- void SetValue( SCROW nRow, const double& rVal);
- void SetError( SCROW nRow, const USHORT nError);
-
-diff --git sc/inc/document.hxx sc/inc/document.hxx
-index 7765273..b31f9d6 100644
---- sc/inc/document.hxx
-+++ sc/inc/document.hxx
-@@ -737,7 +737,9 @@ public:
- SC_DLLPUBLIC void PutCell(SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell,
- ULONG nFormatIndex, BOOL bForceTab = FALSE);
- // return TRUE = Zahlformat gesetzt
-- SC_DLLPUBLIC BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, SvNumberFormatter* pFormatter = NULL );
-+ SC_DLLPUBLIC BOOL SetString(
-+ SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
-+ SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true );
- SC_DLLPUBLIC void SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVal );
- void SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const USHORT nError);
-
-diff --git sc/inc/filter.hxx sc/inc/filter.hxx
-index 275f787..bdc611a 100644
---- sc/inc/filter.hxx
-+++ sc/inc/filter.hxx
-@@ -93,7 +93,9 @@ class ScEEAbsImport {
- virtual ~ScEEAbsImport() {}
- virtual ULONG Read( SvStream& rStream, const String& rBaseURL ) = 0;
- virtual ScRange GetRange() = 0;
-- virtual void WriteToDocument( BOOL bSizeColsRows = FALSE, double nOutputFactor = 1.0, SvNumberFormatter* pFormatter = NULL ) = 0;
-+ virtual void WriteToDocument(
-+ BOOL bSizeColsRows = FALSE, double nOutputFactor = 1.0,
-+ SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true ) = 0;
- };
-
- class ScFormatFilterPlugin {
-@@ -111,7 +113,7 @@ class ScFormatFilterPlugin {
- const CharSet eSrc = RTL_TEXTENCODING_DONTKNOW, UINT32 nDifOption = SC_DIFOPT_EXCEL ) = 0;
- virtual FltError ScImportRTF( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange ) = 0;
- virtual FltError ScImportHTML( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange, double nOutputFactor = 1.0,
-- BOOL bCalcWidthHeight = TRUE, SvNumberFormatter* pFormatter = NULL ) = 0;
-+ BOOL bCalcWidthHeight = TRUE, SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true ) = 0;
-
- // various import helpers
- virtual ScEEAbsImport *CreateRTFImport( ScDocument* pDoc, const ScRange& rRange ) = 0;
-diff --git sc/inc/scabstdlg.hxx sc/inc/scabstdlg.hxx
-index 2c7f1e0..843eb70 100644
---- sc/inc/scabstdlg.hxx
-+++ sc/inc/scabstdlg.hxx
-@@ -309,6 +309,7 @@ class AbstractScLangChooserDlg : public VclAbstractDialog //add for ScLangChoose
- {
- public:
- virtual LanguageType GetLanguageType() const = 0;
-+ virtual bool IsDateConversionSet() const = 0;
- };
-
- //-------Scabstract fractory ---------------------------
-diff --git sc/inc/stringutil.hxx sc/inc/stringutil.hxx
-new file mode 100644
-index 0000000..4ca8629
---- /dev/null
-+++ sc/inc/stringutil.hxx
-@@ -0,0 +1,56 @@
-+/*************************************************************************
-+ *
-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+ *
-+ * Copyright 2008 by Sun Microsystems, Inc.
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: table.hxx,v $
-+ * $Revision: 1.35 $
-+ *
-+ * This file is part of OpenOffice.org.
-+ *
-+ * OpenOffice.org is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License version 3
-+ * only, as published by the Free Software Foundation.
-+ *
-+ * OpenOffice.org is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License version 3 for more details
-+ * (a copy is included in the LICENSE file that accompanied this code).
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * version 3 along with OpenOffice.org. If not, see
-+ * <http://www.openoffice.org/license.html>
-+ * for a copy of the LGPLv3 License.
-+ *
-+ ************************************************************************/
-+
-+#ifndef SC_STRINGUTIL_HXX
-+#define SC_STRINGUTIL_HXX
-+
-+#include "rtl/ustring.hxx"
-+
-+class ScStringUtil
-+{
-+public:
-+ /**
-+ * Check if a given string is a simple decimal number (e.g. 12.345). We
-+ * don't do any elaborate parsing here; we only check for the simplest
-+ * case of decimal number format.
-+ *
-+ * @param rStr string to parse
-+ * @param dsep decimal separator
-+ * @param gsep group separator (aka thousands separator)
-+ * @param rVal value of successfully parsed number
-+ *
-+ * @return true if the string is a valid number, false otherwise.
-+ */
-+ static bool parseSimpleNumber(
-+ const ::rtl::OUString& rStr, sal_Unicode dsep, sal_Unicode gsep, double& rVal);
-+};
-+
-+
-+#endif
-diff --git sc/inc/table.hxx sc/inc/table.hxx
-index a088fe5..5c099c1 100644
---- sc/inc/table.hxx
-+++ sc/inc/table.hxx
-@@ -256,7 +256,8 @@ public:
- void PutCell( SCCOL nCol, SCROW nRow, ScBaseCell* pCell );
- void PutCell(SCCOL nCol, SCROW nRow, ULONG nFormatIndex, ScBaseCell* pCell);
- // TRUE = Zahlformat gesetzt
-- BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, SvNumberFormatter* pFormatter = NULL );
-+ BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
-+ SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true );
- void SetValue( SCCOL nCol, SCROW nRow, const double& rVal );
- void SetError( SCCOL nCol, SCROW nRow, USHORT nError);
-
-diff --git sc/source/core/data/column3.cxx sc/source/core/data/column3.cxx
-index a751418..40f6370 100644
---- sc/source/core/data/column3.cxx
-+++ sc/source/core/data/column3.cxx
-@@ -54,6 +54,13 @@
- #include "markdata.hxx"
- #include "detfunc.hxx" // fuer Notizen bei DeleteRange
- #include "postit.hxx"
-+#include "stringutil.hxx"
-+
-+#include <com/sun/star/i18n/LocaleDataItem.hpp>
-+
-+using ::com::sun::star::i18n::LocaleDataItem;
-+using ::rtl::OUString;
-+using ::rtl::OUStringBuffer;
-
- // Err527 Workaround
- extern const ScFormulaCell* pLastFormulaTreeTop; // in cellform.cxx
-@@ -1219,7 +1226,7 @@ void ScColumn::StartListeningInArea( SCROW nRow1, SCROW nRow2 )
- // TRUE = Zahlformat gesetzt
- BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
- formula::FormulaGrammar::AddressConvention eConv,
-- SvNumberFormatter* pFormatter )
-+ SvNumberFormatter* pFormatter, bool bDetectNumberFormat )
- {
- BOOL bNumFmtSet = FALSE;
- if (VALIDROW(nRow))
-@@ -1299,48 +1306,80 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
- if ( !bIsText )
- nIndex = nOldIndex = pFormatter->GetStandardIndex();
- }
-- if ( !bIsText &&
-- pFormatter->IsNumberFormat(rString, nIndex, nVal) )
-- { // Zahl
-- pNewCell = new ScValueCell( nVal );
-- if ( nIndex != nOldIndex)
-- {
-- // #i22345# New behavior: Apply the detected number format only if
-- // the old one was the default number, date, time or boolean format.
-- // Exception: If the new format is boolean, always apply it.
-
-- BOOL bOverwrite = FALSE;
-- const SvNumberformat* pOldFormat = pFormatter->GetEntry( nOldIndex );
-- if ( pOldFormat )
-+ do
-+ {
-+ if (bIsText)
-+ break;
-+
-+ if (bDetectNumberFormat)
-+ {
-+ if (!pFormatter->IsNumberFormat(rString, nIndex, nVal))
-+ break;
-+
-+ pNewCell = new ScValueCell( nVal );
-+ if ( nIndex != nOldIndex)
- {
-- short nOldType = pOldFormat->GetType() & ~NUMBERFORMAT_DEFINED;
-- if ( nOldType == NUMBERFORMAT_NUMBER || nOldType == NUMBERFORMAT_DATE ||
-- nOldType == NUMBERFORMAT_TIME || nOldType == NUMBERFORMAT_LOGICAL )
-+ // #i22345# New behavior: Apply the detected number format only if
-+ // the old one was the default number, date, time or boolean format.
-+ // Exception: If the new format is boolean, always apply it.
-+
-+ BOOL bOverwrite = FALSE;
-+ const SvNumberformat* pOldFormat = pFormatter->GetEntry( nOldIndex );
-+ if ( pOldFormat )
- {
-- if ( nOldIndex == pFormatter->GetStandardFormat(
-- nOldType, pOldFormat->GetLanguage() ) )
-+ short nOldType = pOldFormat->GetType() & ~NUMBERFORMAT_DEFINED;
-+ if ( nOldType == NUMBERFORMAT_NUMBER || nOldType == NUMBERFORMAT_DATE ||
-+ nOldType == NUMBERFORMAT_TIME || nOldType == NUMBERFORMAT_LOGICAL )
- {
-- bOverwrite = TRUE; // default of these types can be overwritten
-+ if ( nOldIndex == pFormatter->GetStandardFormat(
-+ nOldType, pOldFormat->GetLanguage() ) )
-+ {
-+ bOverwrite = TRUE; // default of these types can be overwritten
-+ }
- }
- }
-- }
-- if ( !bOverwrite && pFormatter->GetType( nIndex ) == NUMBERFORMAT_LOGICAL )
-- {
-- bOverwrite = TRUE; // overwrite anything if boolean was detected
-- }
-+ if ( !bOverwrite && pFormatter->GetType( nIndex ) == NUMBERFORMAT_LOGICAL )
-+ {
-+ bOverwrite = TRUE; // overwrite anything if boolean was detected
-+ }
-
-- if ( bOverwrite )
-- {
-- ApplyAttr( nRow, SfxUInt32Item( ATTR_VALUE_FORMAT,
-- (UINT32) nIndex) );
-- bNumFmtSet = TRUE;
-+ if ( bOverwrite )
-+ {
-+ ApplyAttr( nRow, SfxUInt32Item( ATTR_VALUE_FORMAT,
-+ (UINT32) nIndex) );
-+ bNumFmtSet = TRUE;
-+ }
- }
-- }
-- }
-- else // Text
-- pNewCell = new ScStringCell( rString );
-- }
-- }
-+ }
-+ else
-+ {
-+ // Only check if the string is a regular number.
-+ const LocaleDataWrapper* pLocale = pFormatter->GetLocaleData();
-+ if (!pLocale)
-+ break;
-+
-+ LocaleDataItem aLocaleItem = pLocale->getLocaleItem();
-+ const OUString& rDecSep = aLocaleItem.decimalSeparator;
-+ const OUString& rGroupSep = aLocaleItem.thousandSeparator;
-+ if (rDecSep.getLength() != 1 || rGroupSep.getLength() != 1)
-+ break;
-+
-+ sal_Unicode dsep = rDecSep.getStr()[0];
-+ sal_Unicode gsep = rGroupSep.getStr()[0];
-+
-+ if (!ScStringUtil::parseSimpleNumber(rString, dsep, gsep, nVal))
-+ break;
-+
-+ pNewCell = new ScValueCell(nVal);
-+ }
-+ }
-+ while (false);
-+
-+ if (!pNewCell)
-+ pNewCell = new ScStringCell(rString);
-+ }
-+ }
-
- if ( bIsLoading && (!nCount || nRow > pItems[nCount-1].nRow) )
- { // Search einsparen und ohne Umweg ueber Insert, Listener aufbauen
-diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx
-index 676883e..a3b7e49 100644
---- sc/source/core/data/document.cxx
-+++ sc/source/core/data/document.cxx
-@@ -2451,10 +2451,11 @@ void ScDocument::PutCell( const ScAddress& rPos, ScBaseCell* pCell, BOOL bForceT
- }
-
-
--BOOL ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, SvNumberFormatter* pFormatter )
-+BOOL ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
-+ SvNumberFormatter* pFormatter, bool bDetectNumberFormat )
- {
- if ( ValidTab(nTab) && pTab[nTab] )
-- return pTab[nTab]->SetString( nCol, nRow, nTab, rString, pFormatter );
-+ return pTab[nTab]->SetString( nCol, nRow, nTab, rString, pFormatter, bDetectNumberFormat );
- else
- return FALSE;
- }
-diff --git sc/source/core/data/table2.cxx sc/source/core/data/table2.cxx
-index 768eb27..da392bc 100644
---- sc/source/core/data/table2.cxx
-+++ sc/source/core/data/table2.cxx
-@@ -842,10 +842,12 @@ void ScTable::PutCell( const ScAddress& rPos, ULONG nFormatIndex, ScBaseCell* pC
- }
-
-
--BOOL ScTable::SetString( SCCOL nCol, SCROW nRow, SCTAB nTabP, const String& rString, SvNumberFormatter* pFormatter )
-+BOOL ScTable::SetString( SCCOL nCol, SCROW nRow, SCTAB nTabP, const String& rString,
-+ SvNumberFormatter* pFormatter, bool bDetectNumberFormat )
- {
- if (ValidColRow(nCol,nRow))
-- return aCol[nCol].SetString( nRow, nTabP, rString, pDocument->GetAddressConvention(), pFormatter );
-+ return aCol[nCol].SetString(
-+ nRow, nTabP, rString, pDocument->GetAddressConvention(), pFormatter, bDetectNumberFormat );
- else
- return FALSE;
- }
-diff --git sc/source/core/tool/makefile.mk sc/source/core/tool/makefile.mk
-index 1bf94ea..b54c041 100644
---- sc/source/core/tool/makefile.mk
-+++ sc/source/core/tool/makefile.mk
-@@ -107,6 +107,7 @@ SLOFILES = \
- $(SLO)$/refupdat.obj \
- $(SLO)$/scmatrix.obj \
- $(SLO)$/sctictac.obj \
-+ $(SLO)$/stringutil.obj \
- $(SLO)$/subtotal.obj \
- $(SLO)$/token.obj \
- $(SLO)$/unitconv.obj \
-@@ -130,6 +131,7 @@ EXCEPTIONSFILES= \
- $(SLO)$/lookupcache.obj \
- $(SLO)$/prnsave.obj \
- $(SLO)$/reftokenhelper.obj \
-+ $(SLO)$/stringutil.obj \
- $(SLO)$/token.obj
-
- # [kh] POWERPC compiler problem
-diff --git sc/source/core/tool/stringutil.cxx sc/source/core/tool/stringutil.cxx
-new file mode 100644
-index 0000000..eaf756e
---- /dev/null
-+++ sc/source/core/tool/stringutil.cxx
-@@ -0,0 +1,101 @@
-+/*************************************************************************
-+ *
-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+ *
-+ * Copyright 2008 by Sun Microsystems, Inc.
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: table.hxx,v $
-+ * $Revision: 1.35 $
-+ *
-+ * This file is part of OpenOffice.org.
-+ *
-+ * OpenOffice.org is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License version 3
-+ * only, as published by the Free Software Foundation.
-+ *
-+ * OpenOffice.org is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License version 3 for more details
-+ * (a copy is included in the LICENSE file that accompanied this code).
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * version 3 along with OpenOffice.org. If not, see
-+ * <http://www.openoffice.org/license.html>
-+ * for a copy of the LGPLv3 License.
-+ *
-+ ************************************************************************/
-+
-+// MARKER(update_precomp.py): autogen include statement, do not remove
-+#include "precompiled_sc.hxx"
-+
-+// System - Includes -----------------------------------------------------
-+
-+#include "stringutil.hxx"
-+#include "rtl/ustrbuf.hxx"
-+
-+using ::rtl::OUString;
-+using ::rtl::OUStringBuffer;
-+
-+bool ScStringUtil::parseSimpleNumber(
-+ const OUString& rStr, sal_Unicode dsep, sal_Unicode gsep, double& rVal)
-+{
-+ OUStringBuffer aBuf;
-+ sal_Int32 n = rStr.getLength();
-+ const sal_Unicode* p = rStr.getStr();
-+ sal_Int32 nPosDSep = -1, nPosGSep = -1;
-+ for (sal_Int32 i = 0; i < n; ++i)
-+ {
-+ sal_Unicode c = p[i];
-+ if (sal_Unicode('0') <= c && c <= sal_Unicode('9'))
-+ {
-+ // this is a digit.
-+ aBuf.append(c);
-+ }
-+ else if (c == dsep)
-+ {
-+ // this is a decimal separator.
-+
-+ if (nPosDSep >= 0)
-+ // a second decimal separator -> not a valid number.
-+ return false;
-+ if (nPosGSep >= 0 && i - nPosGSep != 4)
-+ // the number has a group separator and the decimal sep is not
-+ // positioned correctly.
-+ return false;
-+
-+ nPosDSep = i;
-+ aBuf.append(c);
-+ }
-+ else if (c == gsep)
-+ {
-+ // this is a group (thousand) separator.
-+ if (i == 0)
-+ return false;
-+
-+ if (nPosGSep >= 0 && i - nPosGSep != 4)
-+ {
-+ // this group separator is not positioned correctly relative
-+ // to the last group separator.
-+ return false;
-+ }
-+
-+ nPosGSep = i;
-+ }
-+ else if (c == sal_Unicode('-') || c == sal_Unicode('+'))
-+ {
-+ // A sign must be the first character if it's given.
-+ if (i == 0)
-+ aBuf.append(c);
-+ else
-+ return false;
-+ }
-+ else
-+ return false;
-+ }
-+
-+ rVal = aBuf.makeStringAndClear().toDouble();
-+ return true;
-+}
-diff --git sc/source/filter/html/htmlimp.cxx sc/source/filter/html/htmlimp.cxx
-index 3f982b8..8fbd9aa 100644
---- sc/source/filter/html/htmlimp.cxx
-+++ sc/source/filter/html/htmlimp.cxx
-@@ -63,13 +63,14 @@
- //------------------------------------------------------------------------
-
- FltError ScFormatFilterPluginImpl::ScImportHTML( SvStream &rStream, const String& rBaseURL, ScDocument *pDoc,
-- ScRange& rRange, double nOutputFactor, BOOL bCalcWidthHeight, SvNumberFormatter* pFormatter )
-+ ScRange& rRange, double nOutputFactor, BOOL bCalcWidthHeight, SvNumberFormatter* pFormatter,
-+ bool bConvertDate )
- {
- ScHTMLImport aImp( pDoc, rBaseURL, rRange, bCalcWidthHeight );
- FltError nErr = (FltError) aImp.Read( rStream, rBaseURL );
- ScRange aR = aImp.GetRange();
- rRange.aEnd = aR.aEnd;
-- aImp.WriteToDocument( TRUE, nOutputFactor, pFormatter );
-+ aImp.WriteToDocument( TRUE, nOutputFactor, pFormatter, bConvertDate );
- return nErr;
- }
-
-@@ -137,9 +138,10 @@ void ScHTMLImport::InsertRangeName( ScDocument* pDoc, const String& rName, const
- delete pRangeData;
- }
-
--void ScHTMLImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor, SvNumberFormatter* pFormatter )
-+void ScHTMLImport::WriteToDocument(
-+ BOOL bSizeColsRows, double nOutputFactor, SvNumberFormatter* pFormatter, bool bConvertDate )
- {
-- ScEEImport::WriteToDocument( bSizeColsRows, nOutputFactor, pFormatter );
-+ ScEEImport::WriteToDocument( bSizeColsRows, nOutputFactor, pFormatter, bConvertDate );
-
- const ScHTMLParser* pParser = GetParser();
- const ScHTMLTable* pGlobTable = pParser->GetGlobalTable();
-diff --git sc/source/filter/inc/eeimport.hxx sc/source/filter/inc/eeimport.hxx
-index 9be2583..32d7d0a 100644
---- sc/source/filter/inc/eeimport.hxx
-+++ sc/source/filter/inc/eeimport.hxx
-@@ -64,7 +64,8 @@ public:
- virtual ScRange GetRange() { return maRange; }
- virtual void WriteToDocument( BOOL bSizeColsRows = FALSE,
- double nOutputFactor = 1.0,
-- SvNumberFormatter* pFormatter = NULL );
-+ SvNumberFormatter* pFormatter = NULL,
-+ bool bConvertDate = true );
- };
-
- #endif
-diff --git sc/source/filter/inc/ftools.hxx sc/source/filter/inc/ftools.hxx
-index 7b31d01..79c698e 100644
---- sc/source/filter/inc/ftools.hxx
-+++ sc/source/filter/inc/ftools.hxx
-@@ -524,7 +524,7 @@ class ScFormatFilterPluginImpl : public ScFormatFilterPlugin {
- virtual FltError ScImportRTF( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange );
- virtual FltError ScImportHTML( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange,
- double nOutputFactor = 1.0, BOOL bCalcWidthHeight = TRUE,
-- SvNumberFormatter* pFormatter = NULL );
-+ SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true );
-
- virtual ScEEAbsImport *CreateRTFImport( ScDocument* pDoc, const ScRange& rRange );
- virtual ScEEAbsImport *CreateHTMLImport( ScDocument* pDocP, const String& rBaseURL, const ScRange& rRange, BOOL bCalcWidthHeight );
-diff --git sc/source/filter/inc/htmlimp.hxx sc/source/filter/inc/htmlimp.hxx
-index 387edee..aafe91b 100644
---- sc/source/filter/inc/htmlimp.hxx
-+++ sc/source/filter/inc/htmlimp.hxx
-@@ -45,7 +45,8 @@ public:
- virtual ~ScHTMLImport();
- const ScHTMLParser* GetParser() const { return (ScHTMLParser*)mpParser; }
-
-- virtual void WriteToDocument( BOOL bSizeColsRows = FALSE, double nOutputFactor = 1.0, SvNumberFormatter* pFormatter = NULL );
-+ virtual void WriteToDocument( BOOL bSizeColsRows = FALSE, double nOutputFactor = 1.0,
-+ SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true );
-
- static String GetHTMLRangeNameList( ScDocument* pDoc, const String& rOrigName );
- };
-diff --git sc/source/filter/rtf/eeimpars.cxx sc/source/filter/rtf/eeimpars.cxx
-index df5a98b..e4b28a7 100644
---- sc/source/filter/rtf/eeimpars.cxx
-+++ sc/source/filter/rtf/eeimpars.cxx
-@@ -129,7 +129,7 @@ ULONG ScEEImport::Read( SvStream& rStream, const String& rBaseURL )
- }
-
-
--void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor, SvNumberFormatter* pFormatter )
-+void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor, SvNumberFormatter* pFormatter, bool bConvertDate )
- {
- ScProgress* pProgress = new ScProgress( mpDoc->GetDocumentShell(),
- ScGlobal::GetRscString( STR_LOAD_DOC ), mpParser->Count() );
-@@ -381,7 +381,7 @@ void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor, SvNu
- if (bNumbersEnglishUS && !bEnUsRecognized)
- mpDoc->PutCell( nCol, nRow, nTab, new ScStringCell( aStr));
- else
-- mpDoc->SetString( nCol, nRow, nTab, aStr, pFormatter );
-+ mpDoc->SetString( nCol, nRow, nTab, aStr, pFormatter, bConvertDate );
- }
- }
- else
-diff --git sc/source/ui/attrdlg/scdlgfact.cxx sc/source/ui/attrdlg/scdlgfact.cxx
-index ac23eb4..f42e8fc 100644
---- sc/source/ui/attrdlg/scdlgfact.cxx
-+++ sc/source/ui/attrdlg/scdlgfact.cxx
-@@ -639,6 +639,12 @@ LanguageType AbstractScLangChooserDlg_Impl::GetLanguageType() const
- {
- return pDlg->getLanguageType();
- }
-+
-+bool AbstractScLangChooserDlg_Impl::IsDateConversionSet() const
-+{
-+ return pDlg->isDateConversionSet();
-+}
-+
- //add for AbstractScLangChooserDlg_Impl end
-
- // =========================Factories for createdialog ===================
-diff --git sc/source/ui/attrdlg/scdlgfact.hxx sc/source/ui/attrdlg/scdlgfact.hxx
-index 4468686..07255ff 100644
---- sc/source/ui/attrdlg/scdlgfact.hxx
-+++ sc/source/ui/attrdlg/scdlgfact.hxx
-@@ -361,6 +361,7 @@ class AbstractScLangChooserDlg_Impl : public AbstractScLangChooserDlg
- {
- DECL_ABSTDLG_BASE( AbstractScLangChooserDlg_Impl, ScLangChooserDlg)
- virtual LanguageType GetLanguageType() const;
-+ virtual bool IsDateConversionSet() const;
- };
-
- //add for ScAttrDlg , ScHFEditDlg, ScStyleDlg, ScSubTotalDlg, ScCharDlg, ScParagraphDlg, ScValidationDlg, ScSortDlg
-diff --git sc/source/ui/dbgui/langchooser.cxx sc/source/ui/dbgui/langchooser.cxx
-index 59a7259..d5fd72b 100644
---- sc/source/ui/dbgui/langchooser.cxx
-+++ sc/source/ui/dbgui/langchooser.cxx
-@@ -52,7 +52,9 @@ ScLangChooserDlg::ScLangChooserDlg(Window* pParent) :
- maFlChooseLang(this, ScResId(FL_CHOOSE_LANG)),
- maRbAutomatic(this, ScResId(RB_AUTOMATIC)),
- maRbCustom(this, ScResId(RB_CUSTOM)),
-- maLbCustomLang(this, ScResId(LB_CUSTOM_LANG))
-+ maLbCustomLang(this, ScResId(LB_CUSTOM_LANG)),
-+ maFlOption(this, ScResId(FL_OPTION)),
-+ maBtnConvertDate(this, ScResId(BTN_CONVERT_DATE))
- {
- init();
- }
-@@ -74,6 +76,11 @@ LanguageType ScLangChooserDlg::getLanguageType() const
- return maLbCustomLang.GetSelectLanguage();
- }
-
-+bool ScLangChooserDlg::isDateConversionSet() const
-+{
-+ return maBtnConvertDate.IsChecked();
-+}
-+
- void ScLangChooserDlg::init()
- {
- Link aLink = LINK( this, ScLangChooserDlg, OKHdl );
-diff --git sc/source/ui/dbgui/langchooser.src sc/source/ui/dbgui/langchooser.src
-index ace6782..1e121de 100644
---- sc/source/ui/dbgui/langchooser.src
-+++ sc/source/ui/dbgui/langchooser.src
-@@ -33,7 +33,7 @@
- ModalDialog RID_SCDLG_LANG_CHOOSER
- {
- Text [ en-US ] = "Select Language" ;
-- Size = MAP_APPFONT ( 190 , 70 ) ;
-+ Size = MAP_APPFONT ( 190 , 101 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- OutputSize = TRUE ;
-@@ -91,5 +91,22 @@ ModalDialog RID_SCDLG_LANG_CHOOSER
- DropDown = TRUE ;
- Sort = TRUE ;
- };
-+
-+ FixedLine FL_OPTION
-+ {
-+ Pos = MAP_APPFONT( 6, 70 );
-+ Size = MAP_APPFONT( 125, 14 );
-+
-+ Text [ en-US ] = "Options" ;
-+ };
-+
-+ CheckBox BTN_CONVERT_DATE
-+ {
-+ Pos = MAP_APPFONT( 12, 86 );
-+ Size = MAP_APPFONT( 125, 10 );
-+ TabStop = TRUE ;
-+
-+ Text [ en-US ] = "Detect special numbers (such as dates)." ;
-+ };
- };
-
-diff --git sc/source/ui/docshell/docsh.cxx sc/source/ui/docshell/docsh.cxx
-index 9caaf5f..695dc81 100644
---- sc/source/ui/docshell/docsh.cxx
-+++ sc/source/ui/docshell/docsh.cxx
-@@ -137,6 +137,8 @@ using namespace com::sun::star;
- using namespace com::sun::star::document::VbaEventId;
-
- using namespace com::sun::star;
-+using ::rtl::OUString;
-+using ::rtl::OUStringBuffer;
-
- // STATIC DATA -----------------------------------------------------------
-
-@@ -898,6 +900,34 @@ BOOL __EXPORT ScDocShell::LoadFrom( SfxMedium& rMedium )
- return bRet;
- }
-
-+static void lcl_parseHtmlFilterOption(const OUString& rOption, LanguageType& rLang, bool& rDateConvert)
-+{
-+ OUStringBuffer aBuf;
-+ OUString aTokens[2];
-+ sal_Int32 n = rOption.getLength();
-+ const sal_Unicode* p = rOption.getStr();
-+ sal_Int32 nTokenId = 0;
-+ for (sal_Int32 i = 0; i < n; ++i)
-+ {
-+ const sal_Unicode c = p[i];
-+ if (c == sal_Unicode(' '))
-+ {
-+ if (aBuf.getLength())
-+ aTokens[nTokenId++] = aBuf.makeStringAndClear();
-+ }
-+ else
-+ aBuf.append(c);
-+
-+ if (nTokenId >= 2)
-+ break;
-+ }
-+
-+ if (aBuf.getLength())
-+ aTokens[nTokenId] = aBuf.makeStringAndClear();
-+
-+ rLang = static_cast<LanguageType>(aTokens[0].toInt32());
-+ rDateConvert = static_cast<bool>(aTokens[1].toInt32());
-+}
-
- BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
- {
-@@ -1273,13 +1303,14 @@ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
- if (pInStream)
- {
- LanguageType eLang = LANGUAGE_SYSTEM;
-+ bool bDateConvert = false;
- SfxItemSet* pSet = rMedium.GetItemSet();
- const SfxPoolItem* pItem;
- if ( pSet && SFX_ITEM_SET ==
- pSet->GetItemState( SID_FILE_FILTEROPTIONS, TRUE, &pItem ) )
- {
- String aFilterOption = (static_cast<const SfxStringItem*>(pItem))->GetValue();
-- eLang = static_cast<LanguageType>(aFilterOption.ToInt32());
-+ lcl_parseHtmlFilterOption(aFilterOption, eLang, bDateConvert);
- }
-
- pInStream->Seek( 0 );
-@@ -1288,7 +1319,7 @@ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
- CalcOutputFactor();
- SvNumberFormatter aNumFormatter(aDocument.GetServiceManager(), eLang);
- eError = ScFormatFilter::Get().ScImportHTML( *pInStream, rMedium.GetBaseURL(), &aDocument, aRange,
-- GetOutputFactor(), !bWebQuery, &aNumFormatter );
-+ GetOutputFactor(), !bWebQuery, &aNumFormatter, bDateConvert );
- if (eError != eERR_OK)
- {
- if (!GetError())
-diff --git sc/source/ui/docshell/impex.cxx sc/source/ui/docshell/impex.cxx
-index 83dd6da..e2ccdf5 100644
---- sc/source/ui/docshell/impex.cxx
-+++ sc/source/ui/docshell/impex.cxx
-@@ -1943,7 +1943,7 @@ class ScFormatFilterMissing : public ScFormatFilterPlugin {
- virtual FltError ScImportDif( SvStream&, ScDocument*, const ScAddress&,
- const CharSet, UINT32 ) RETURN_ERROR
- virtual FltError ScImportRTF( SvStream&, const String&, ScDocument*, ScRange& ) RETURN_ERROR
-- virtual FltError ScImportHTML( SvStream&, const String&, ScDocument*, ScRange&, double, BOOL, SvNumberFormatter* ) RETURN_ERROR
-+ virtual FltError ScImportHTML( SvStream&, const String&, ScDocument*, ScRange&, double, BOOL, SvNumberFormatter*, bool ) RETURN_ERROR
-
- virtual ScEEAbsImport *CreateRTFImport( ScDocument*, const ScRange& ) { return NULL; }
- virtual ScEEAbsImport *CreateHTMLImport( ScDocument*, const String&, const ScRange&, BOOL ) { return NULL; }
-diff --git sc/source/ui/inc/langchooser.hrc sc/source/ui/inc/langchooser.hrc
-index fb0be37..eb981c1 100644
---- sc/source/ui/inc/langchooser.hrc
-+++ sc/source/ui/inc/langchooser.hrc
-@@ -38,4 +38,5 @@
- #define RB_AUTOMATIC 5
- #define RB_CUSTOM 6
- #define LB_CUSTOM_LANG 7
--
-+#define FL_OPTION 8
-+#define BTN_CONVERT_DATE 9
-diff --git sc/source/ui/inc/langchooser.hxx sc/source/ui/inc/langchooser.hxx
-index 7c63973..7106ab2 100644
---- sc/source/ui/inc/langchooser.hxx
-+++ sc/source/ui/inc/langchooser.hxx
-@@ -46,6 +46,7 @@ public:
- virtual short Execute();
-
- LanguageType getLanguageType() const;
-+ bool isDateConversionSet() const;
-
- private:
- void init();
-@@ -62,7 +63,9 @@ private:
-
- SvxLanguageBox maLbCustomLang;
-
-- String maString;
-+ FixedLine maFlOption;
-+
-+ CheckBox maBtnConvertDate;
-
- DECL_LINK( OKHdl, OKButton* );
-
-diff --git sc/source/ui/unoobj/filtuno.cxx sc/source/ui/unoobj/filtuno.cxx
-index 99c1045..b119cda 100644
---- sc/source/ui/unoobj/filtuno.cxx
-+++ sc/source/ui/unoobj/filtuno.cxx
-@@ -56,6 +56,7 @@
- #include <memory>
-
- using namespace ::com::sun::star;
-+using ::rtl::OUStringBuffer;
-
- //------------------------------------------------------------------------
-
-@@ -193,7 +194,12 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException)
- if (pDlg->Execute() == RET_OK)
- {
- LanguageType eLang = pDlg->GetLanguageType();
-- aFilterOptions = String::CreateFromInt32(static_cast<sal_Int32>(eLang));
-+ OUStringBuffer aBuf;
-+
-+ aBuf.append(String::CreateFromInt32(static_cast<sal_Int32>(eLang)));
-+ aBuf.append(sal_Unicode(' '));
-+ aBuf.append(pDlg->IsDateConversionSet() ? sal_Unicode('1') : sal_Unicode('0'));
-+ aFilterOptions = aBuf.makeStringAndClear();
- nRet = ui::dialogs::ExecutableDialogResults::OK;
- }
- }
diff --git a/patches/dev300/calc-html-import-custom-lang-sc-fix.diff b/patches/dev300/calc-html-import-custom-lang-sc-fix.diff
deleted file mode 100644
index caf2e9e..0000000
--- a/patches/dev300/calc-html-import-custom-lang-sc-fix.diff
+++ /dev/null
@@ -1,41 +0,0 @@
-diff --git sc/source/ui/docshell/docsh.cxx sc/source/ui/docshell/docsh.cxx
-index 695dc81..e1808e7 100644
---- sc/source/ui/docshell/docsh.cxx
-+++ sc/source/ui/docshell/docsh.cxx
-@@ -2309,6 +2309,11 @@ String ScDocShell::GetOwnFilterName() // static
- return String::CreateFromAscii(pFilterSc50);
- }
-
-+String ScDocShell::GetHtmlFilterName()
-+{
-+ return String::CreateFromAscii(pFilterHtml);
-+}
-+
- String ScDocShell::GetWebQueryFilterName() // static
- {
- return String::CreateFromAscii(pFilterHtmlWebQ);
-diff --git sc/source/ui/inc/docsh.hxx sc/source/ui/inc/docsh.hxx
-index 1126a95..7620368 100644
---- sc/source/ui/inc/docsh.hxx
-+++ sc/source/ui/inc/docsh.hxx
-@@ -409,6 +409,7 @@ public:
-
- static ScDocShell* GetShellByNum( USHORT nDocNo );
- static String GetOwnFilterName();
-+ static String GetHtmlFilterName();
- static String GetWebQueryFilterName();
- static String GetAsciiFilterName();
- static String GetLotusFilterName();
-diff --git sc/source/ui/unoobj/filtuno.cxx sc/source/ui/unoobj/filtuno.cxx
-index b119cda..406255e 100644
---- sc/source/ui/unoobj/filtuno.cxx
-+++ sc/source/ui/unoobj/filtuno.cxx
-@@ -185,7 +185,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException)
- delete pDlg;
- delete pInStream;
- }
-- else if ( aFilterString == ScDocShell::GetWebQueryFilterName() )
-+ else if ( aFilterString == ScDocShell::GetWebQueryFilterName() || aFilterString == ScDocShell::GetHtmlFilterName() )
- {
- // HTML import.
- ::std::auto_ptr<AbstractScLangChooserDlg> pDlg(
diff --git a/patches/dev300/calc-html-import-custom-lang-sc.diff b/patches/dev300/calc-html-import-custom-lang-sc.diff
index a86d97c..d104acc 100644
--- a/patches/dev300/calc-html-import-custom-lang-sc.diff
+++ b/patches/dev300/calc-html-import-custom-lang-sc.diff
@@ -1,28 +1,37 @@
---- sc/inc/column.hxx.old 2009-04-06 16:41:50.000000000 +0000
-+++ sc/inc/column.hxx 2009-04-06 16:42:07.000000000 +0000
-@@ -243,7 +243,8 @@ public:
+diff --git sc/inc/column.hxx sc/inc/column.hxx
+index 7d297e1..babda9e 100644
+--- sc/inc/column.hxx
++++ sc/inc/column.hxx
+@@ -243,7 +243,9 @@ public:
// TRUE = Zahlformat gesetzt
BOOL SetString( SCROW nRow, SCTAB nTab, const String& rString,
- formula::FormulaGrammar::AddressConvention conv = formula::FormulaGrammar::CONV_OOO );
+ formula::FormulaGrammar::AddressConvention conv = formula::FormulaGrammar::CONV_OOO,
-+ SvNumberFormatter* pFormatter = NULL );
++ SvNumberFormatter* pFormatter = NULL,
++ bool bDetectNumberFormat = true );
void SetValue( SCROW nRow, const double& rVal);
void SetError( SCROW nRow, const USHORT nError);
---- sc/inc/document.hxx.old 2009-04-06 16:42:05.000000000 +0000
-+++ sc/inc/document.hxx 2009-04-06 16:42:07.000000000 +0000
-@@ -733,7 +733,7 @@ public:
+diff --git sc/inc/document.hxx sc/inc/document.hxx
+index 528ef96..0da5a7a 100644
+--- sc/inc/document.hxx
++++ sc/inc/document.hxx
+@@ -736,7 +736,9 @@ public:
SC_DLLPUBLIC void PutCell(SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell,
ULONG nFormatIndex, BOOL bForceTab = FALSE);
// return TRUE = Zahlformat gesetzt
- SC_DLLPUBLIC BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString );
-+ SC_DLLPUBLIC BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, SvNumberFormatter* pFormatter = NULL );
++ SC_DLLPUBLIC BOOL SetString(
++ SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
++ SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true );
SC_DLLPUBLIC void SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVal );
void SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const USHORT nError);
---- sc/inc/filter.hxx.old 2009-04-02 10:45:43.000000000 +0000
-+++ sc/inc/filter.hxx 2009-04-06 16:42:07.000000000 +0000
+diff --git sc/inc/filter.hxx sc/inc/filter.hxx
+index 82a2b84..63c9ec6 100644
+--- sc/inc/filter.hxx
++++ sc/inc/filter.hxx
@@ -42,6 +42,7 @@ class SvStream;
class ScAddress;
class ScDocument;
@@ -31,27 +40,31 @@
// Return-Werte Im-/Exportfilter (ULONG)
-@@ -92,7 +93,7 @@ class ScEEAbsImport {
+@@ -92,7 +93,9 @@ class ScEEAbsImport {
virtual ~ScEEAbsImport() {}
virtual ULONG Read( SvStream& rStream, const String& rBaseURL ) = 0;
virtual ScRange GetRange() = 0;
- virtual void WriteToDocument( BOOL bSizeColsRows = FALSE, double nOutputFactor = 1.0 ) = 0;
-+ virtual void WriteToDocument( BOOL bSizeColsRows = FALSE, double nOutputFactor = 1.0, SvNumberFormatter* pFormatter = NULL ) = 0;
++ virtual void WriteToDocument(
++ BOOL bSizeColsRows = FALSE, double nOutputFactor = 1.0,
++ SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true ) = 0;
};
class ScFormatFilterPlugin {
-@@ -109,7 +110,8 @@ class ScFormatFilterPlugin {
+@@ -109,7 +112,8 @@ class ScFormatFilterPlugin {
virtual FltError ScImportDif( SvStream&, ScDocument*, const ScAddress& rInsPos,
const CharSet eSrc = RTL_TEXTENCODING_DONTKNOW, UINT32 nDifOption = SC_DIFOPT_EXCEL ) = 0;
virtual FltError ScImportRTF( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange ) = 0;
- virtual FltError ScImportHTML( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange, double nOutputFactor = 1.0, BOOL bCalcWidthHeight = TRUE ) = 0;
+ virtual FltError ScImportHTML( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange, double nOutputFactor = 1.0,
-+ BOOL bCalcWidthHeight = TRUE, SvNumberFormatter* pFormatter = NULL ) = 0;
++ BOOL bCalcWidthHeight = TRUE, SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true ) = 0;
// various import helpers
virtual ScEEAbsImport *CreateRTFImport( ScDocument* pDoc, const ScRange& rRange ) = 0;
---- sc/inc/sc.hrc.old 2009-04-06 16:42:06.000000000 +0000
-+++ sc/inc/sc.hrc 2009-04-06 16:42:07.000000000 +0000
+diff --git sc/inc/sc.hrc sc/inc/sc.hrc
+index 2c7ad7b..cf99a55 100644
+--- sc/inc/sc.hrc
++++ sc/inc/sc.hrc
@@ -1673,6 +1673,9 @@
#define RID_SCDLG_TAB_BG_COLOR (SC_OOO_BUILD_START + 11)
@@ -62,8 +75,10 @@
#endif
---- sc/inc/scabstdlg.hxx.old 2009-04-06 16:42:06.000000000 +0000
-+++ sc/inc/scabstdlg.hxx 2009-04-06 16:42:07.000000000 +0000
+diff --git sc/inc/scabstdlg.hxx sc/inc/scabstdlg.hxx
+index 637682d..1c9f587 100644
+--- sc/inc/scabstdlg.hxx
++++ sc/inc/scabstdlg.hxx
@@ -41,6 +41,7 @@
#include "sc.hrc"
#include "global.hxx"
@@ -72,7 +87,7 @@
#include <tabvwsh.hxx>
-@@ -303,6 +304,13 @@ class AbstractScImportOptionsDlg : publi
+@@ -303,6 +304,14 @@ class AbstractScImportOptionsDlg : public VclAbstractDialog //add for ScImportO
public:
virtual void GetImportOptions( ScImportOptions& rOptions ) const = 0;
};
@@ -81,12 +96,13 @@
+{
+public:
+ virtual LanguageType GetLanguageType() const = 0;
++ virtual bool IsDateConversionSet() const = 0;
+};
+
//-------Scabstract fractory ---------------------------
class ScAbstractDialogFactory
{
-@@ -313,6 +321,8 @@ public:
+@@ -313,6 +322,8 @@ public:
SvStream* pInStream, int nId,
sal_Unicode cSep = '\t') = 0;
@@ -95,30 +111,49 @@
virtual AbstractScAutoFormatDlg * CreateScAutoFormatDlg( Window* pParent, //add for ScAutoFormatDlg
ScAutoFormat* pAutoFormat,
const ScAutoFormatData* pSelFormatData,
---- sc/inc/table.hxx.old 2009-04-06 16:42:06.000000000 +0000
-+++ sc/inc/table.hxx 2009-04-06 16:42:07.000000000 +0000
-@@ -253,7 +253,7 @@ public:
+diff --git sc/inc/table.hxx sc/inc/table.hxx
+index b95c40c..ea24628 100644
+--- sc/inc/table.hxx
++++ sc/inc/table.hxx
+@@ -253,7 +253,8 @@ public:
void PutCell( SCCOL nCol, SCROW nRow, ScBaseCell* pCell );
void PutCell(SCCOL nCol, SCROW nRow, ULONG nFormatIndex, ScBaseCell* pCell);
// TRUE = Zahlformat gesetzt
- BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString );
-+ BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, SvNumberFormatter* pFormatter = NULL );
++ BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
++ SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true );
void SetValue( SCCOL nCol, SCROW nRow, const double& rVal );
void SetError( SCCOL nCol, SCROW nRow, USHORT nError);
---- sc/source/core/data/column3.cxx.old 2009-04-06 16:42:07.000000000 +0000
-+++ sc/source/core/data/column3.cxx 2009-04-06 16:42:07.000000000 +0000
-@@ -1218,7 +1218,8 @@ void ScColumn::StartListeningInArea( SCR
+diff --git sc/source/core/data/column3.cxx sc/source/core/data/column3.cxx
+index b1fac42..40f6370 100644
+--- sc/source/core/data/column3.cxx
++++ sc/source/core/data/column3.cxx
+@@ -54,6 +54,13 @@
+ #include "markdata.hxx"
+ #include "detfunc.hxx" // fuer Notizen bei DeleteRange
+ #include "postit.hxx"
++#include "stringutil.hxx"
++
++#include <com/sun/star/i18n/LocaleDataItem.hpp>
++
++using ::com::sun::star::i18n::LocaleDataItem;
++using ::rtl::OUString;
++using ::rtl::OUStringBuffer;
+
+ // Err527 Workaround
+ extern const ScFormulaCell* pLastFormulaTreeTop; // in cellform.cxx
+@@ -1218,7 +1225,8 @@ void ScColumn::StartListeningInArea( SCROW nRow1, SCROW nRow2 )
// TRUE = Zahlformat gesetzt
BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
- formula::FormulaGrammar::AddressConvention eConv )
+ formula::FormulaGrammar::AddressConvention eConv,
-+ SvNumberFormatter* pFormatter )
++ SvNumberFormatter* pFormatter, bool bDetectNumberFormat )
{
BOOL bNumFmtSet = FALSE;
if (VALIDROW(nRow))
-@@ -1230,7 +1231,8 @@ BOOL ScColumn::SetString( SCROW nRow, SC
+@@ -1230,7 +1238,8 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
double nVal;
sal_uInt32 nIndex, nOldIndex = 0;
sal_Unicode cFirstChar;
@@ -128,114 +163,270 @@
SfxObjectShell* pDocSh = pDocument->GetDocumentShell();
if ( pDocSh )
bIsLoading = pDocSh->IsLoading();
---- sc/source/core/data/document.cxx.old 2009-04-06 16:41:59.000000000 +0000
-+++ sc/source/core/data/document.cxx 2009-04-06 16:42:07.000000000 +0000
-@@ -2447,10 +2447,10 @@ void ScDocument::PutCell( const ScAddres
+@@ -1297,48 +1306,80 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
+ if ( !bIsText )
+ nIndex = nOldIndex = pFormatter->GetStandardIndex();
+ }
+- if ( !bIsText &&
+- pFormatter->IsNumberFormat(rString, nIndex, nVal) )
+- { // Zahl
+- pNewCell = new ScValueCell( nVal );
+- if ( nIndex != nOldIndex)
+- {
+- // #i22345# New behavior: Apply the detected number format only if
+- // the old one was the default number, date, time or boolean format.
+- // Exception: If the new format is boolean, always apply it.
+
+- BOOL bOverwrite = FALSE;
+- const SvNumberformat* pOldFormat = pFormatter->GetEntry( nOldIndex );
+- if ( pOldFormat )
++ do
++ {
++ if (bIsText)
++ break;
++
++ if (bDetectNumberFormat)
++ {
++ if (!pFormatter->IsNumberFormat(rString, nIndex, nVal))
++ break;
++
++ pNewCell = new ScValueCell( nVal );
++ if ( nIndex != nOldIndex)
+ {
+- short nOldType = pOldFormat->GetType() & ~NUMBERFORMAT_DEFINED;
+- if ( nOldType == NUMBERFORMAT_NUMBER || nOldType == NUMBERFORMAT_DATE ||
+- nOldType == NUMBERFORMAT_TIME || nOldType == NUMBERFORMAT_LOGICAL )
++ // #i22345# New behavior: Apply the detected number format only if
++ // the old one was the default number, date, time or boolean format.
++ // Exception: If the new format is boolean, always apply it.
++
++ BOOL bOverwrite = FALSE;
++ const SvNumberformat* pOldFormat = pFormatter->GetEntry( nOldIndex );
++ if ( pOldFormat )
+ {
+- if ( nOldIndex == pFormatter->GetStandardFormat(
+- nOldType, pOldFormat->GetLanguage() ) )
++ short nOldType = pOldFormat->GetType() & ~NUMBERFORMAT_DEFINED;
++ if ( nOldType == NUMBERFORMAT_NUMBER || nOldType == NUMBERFORMAT_DATE ||
++ nOldType == NUMBERFORMAT_TIME || nOldType == NUMBERFORMAT_LOGICAL )
+ {
+- bOverwrite = TRUE; // default of these types can be overwritten
++ if ( nOldIndex == pFormatter->GetStandardFormat(
++ nOldType, pOldFormat->GetLanguage() ) )
++ {
++ bOverwrite = TRUE; // default of these types can be overwritten
++ }
+ }
+ }
+- }
+- if ( !bOverwrite && pFormatter->GetType( nIndex ) == NUMBERFORMAT_LOGICAL )
+- {
+- bOverwrite = TRUE; // overwrite anything if boolean was detected
+- }
++ if ( !bOverwrite && pFormatter->GetType( nIndex ) == NUMBERFORMAT_LOGICAL )
++ {
++ bOverwrite = TRUE; // overwrite anything if boolean was detected
++ }
+
+- if ( bOverwrite )
+- {
+- ApplyAttr( nRow, SfxUInt32Item( ATTR_VALUE_FORMAT,
+- (UINT32) nIndex) );
+- bNumFmtSet = TRUE;
++ if ( bOverwrite )
++ {
++ ApplyAttr( nRow, SfxUInt32Item( ATTR_VALUE_FORMAT,
++ (UINT32) nIndex) );
++ bNumFmtSet = TRUE;
++ }
+ }
+- }
+- }
+- else // Text
+- pNewCell = new ScStringCell( rString );
+- }
+- }
++ }
++ else
++ {
++ // Only check if the string is a regular number.
++ const LocaleDataWrapper* pLocale = pFormatter->GetLocaleData();
++ if (!pLocale)
++ break;
++
++ LocaleDataItem aLocaleItem = pLocale->getLocaleItem();
++ const OUString& rDecSep = aLocaleItem.decimalSeparator;
++ const OUString& rGroupSep = aLocaleItem.thousandSeparator;
++ if (rDecSep.getLength() != 1 || rGroupSep.getLength() != 1)
++ break;
++
++ sal_Unicode dsep = rDecSep.getStr()[0];
++ sal_Unicode gsep = rGroupSep.getStr()[0];
++
++ if (!ScStringUtil::parseSimpleNumber(rString, dsep, gsep, nVal))
++ break;
++
++ pNewCell = new ScValueCell(nVal);
++ }
++ }
++ while (false);
++
++ if (!pNewCell)
++ pNewCell = new ScStringCell(rString);
++ }
++ }
+
+ if ( bIsLoading && (!nCount || nRow > pItems[nCount-1].nRow) )
+ { // Search einsparen und ohne Umweg ueber Insert, Listener aufbauen
+diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx
+index 6c96215..a3b7e49 100644
+--- sc/source/core/data/document.cxx
++++ sc/source/core/data/document.cxx
+@@ -2451,10 +2451,11 @@ void ScDocument::PutCell( const ScAddress& rPos, ScBaseCell* pCell, BOOL bForceT
}
-BOOL ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString )
-+BOOL ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, SvNumberFormatter* pFormatter )
++BOOL ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
++ SvNumberFormatter* pFormatter, bool bDetectNumberFormat )
{
if ( ValidTab(nTab) && pTab[nTab] )
- return pTab[nTab]->SetString( nCol, nRow, nTab, rString );
-+ return pTab[nTab]->SetString( nCol, nRow, nTab, rString, pFormatter );
++ return pTab[nTab]->SetString( nCol, nRow, nTab, rString, pFormatter, bDetectNumberFormat );
else
return FALSE;
}
---- sc/source/core/data/table2.cxx.old 2009-04-06 16:42:06.000000000 +0000
-+++ sc/source/core/data/table2.cxx 2009-04-06 16:42:07.000000000 +0000
-@@ -841,10 +841,10 @@ void ScTable::PutCell( const ScAddress&
+diff --git sc/source/core/data/table2.cxx sc/source/core/data/table2.cxx
+index d2f8710..8cb6f7a 100644
+--- sc/source/core/data/table2.cxx
++++ sc/source/core/data/table2.cxx
+@@ -841,10 +841,12 @@ void ScTable::PutCell( const ScAddress& rPos, ULONG nFormatIndex, ScBaseCell* pC
}
-BOOL ScTable::SetString( SCCOL nCol, SCROW nRow, SCTAB nTabP, const String& rString )
-+BOOL ScTable::SetString( SCCOL nCol, SCROW nRow, SCTAB nTabP, const String& rString, SvNumberFormatter* pFormatter )
++BOOL ScTable::SetString( SCCOL nCol, SCROW nRow, SCTAB nTabP, const String& rString,
++ SvNumberFormatter* pFormatter, bool bDetectNumberFormat )
{
if (ValidColRow(nCol,nRow))
- return aCol[nCol].SetString( nRow, nTabP, rString );
-+ return aCol[nCol].SetString( nRow, nTabP, rString, pDocument->GetAddressConvention(), pFormatter );
++ return aCol[nCol].SetString(
++ nRow, nTabP, rString, pDocument->GetAddressConvention(), pFormatter, bDetectNumberFormat );
else
return FALSE;
}
---- sc/source/filter/html/htmlimp.cxx.old 2009-04-02 10:44:57.000000000 +0000
-+++ sc/source/filter/html/htmlimp.cxx 2009-04-06 16:42:07.000000000 +0000
-@@ -63,13 +63,13 @@
+diff --git sc/source/core/tool/makefile.mk sc/source/core/tool/makefile.mk
+index 1bf94ea..b54c041 100644
+--- sc/source/core/tool/makefile.mk
++++ sc/source/core/tool/makefile.mk
+@@ -107,6 +107,7 @@ SLOFILES = \
+ $(SLO)$/refupdat.obj \
+ $(SLO)$/scmatrix.obj \
+ $(SLO)$/sctictac.obj \
++ $(SLO)$/stringutil.obj \
+ $(SLO)$/subtotal.obj \
+ $(SLO)$/token.obj \
+ $(SLO)$/unitconv.obj \
+@@ -130,6 +131,7 @@ EXCEPTIONSFILES= \
+ $(SLO)$/lookupcache.obj \
+ $(SLO)$/prnsave.obj \
+ $(SLO)$/reftokenhelper.obj \
++ $(SLO)$/stringutil.obj \
+ $(SLO)$/token.obj
+
+ # [kh] POWERPC compiler problem
+diff --git sc/source/filter/html/htmlimp.cxx sc/source/filter/html/htmlimp.cxx
+index 8c92f3d..8fbd9aa 100644
+--- sc/source/filter/html/htmlimp.cxx
++++ sc/source/filter/html/htmlimp.cxx
+@@ -63,13 +63,14 @@
//------------------------------------------------------------------------
FltError ScFormatFilterPluginImpl::ScImportHTML( SvStream &rStream, const String& rBaseURL, ScDocument *pDoc,
- ScRange& rRange, double nOutputFactor, BOOL bCalcWidthHeight )
-+ ScRange& rRange, double nOutputFactor, BOOL bCalcWidthHeight, SvNumberFormatter* pFormatter )
++ ScRange& rRange, double nOutputFactor, BOOL bCalcWidthHeight, SvNumberFormatter* pFormatter,
++ bool bConvertDate )
{
ScHTMLImport aImp( pDoc, rBaseURL, rRange, bCalcWidthHeight );
FltError nErr = (FltError) aImp.Read( rStream, rBaseURL );
ScRange aR = aImp.GetRange();
rRange.aEnd = aR.aEnd;
- aImp.WriteToDocument( TRUE, nOutputFactor );
-+ aImp.WriteToDocument( TRUE, nOutputFactor, pFormatter );
++ aImp.WriteToDocument( TRUE, nOutputFactor, pFormatter, bConvertDate );
return nErr;
}
-@@ -137,9 +137,9 @@ void ScHTMLImport::InsertRangeName( ScDo
+@@ -137,9 +138,10 @@ void ScHTMLImport::InsertRangeName( ScDocument* pDoc, const String& rName, const
delete pRangeData;
}
-void ScHTMLImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor )
-+void ScHTMLImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor, SvNumberFormatter* pFormatter )
++void ScHTMLImport::WriteToDocument(
++ BOOL bSizeColsRows, double nOutputFactor, SvNumberFormatter* pFormatter, bool bConvertDate )
{
- ScEEImport::WriteToDocument( bSizeColsRows, nOutputFactor );
-+ ScEEImport::WriteToDocument( bSizeColsRows, nOutputFactor, pFormatter );
++ ScEEImport::WriteToDocument( bSizeColsRows, nOutputFactor, pFormatter, bConvertDate );
const ScHTMLParser* pParser = GetParser();
const ScHTMLTable* pGlobTable = pParser->GetGlobalTable();
---- sc/source/filter/inc/eeimport.hxx.old 2009-04-02 10:44:58.000000000 +0000
-+++ sc/source/filter/inc/eeimport.hxx 2009-04-06 16:42:07.000000000 +0000
-@@ -63,7 +63,8 @@ public:
+diff --git sc/source/filter/inc/eeimport.hxx sc/source/filter/inc/eeimport.hxx
+index fef4486..32d7d0a 100644
+--- sc/source/filter/inc/eeimport.hxx
++++ sc/source/filter/inc/eeimport.hxx
+@@ -63,7 +63,9 @@ public:
virtual ULONG Read( SvStream& rStream, const String& rBaseURL );
virtual ScRange GetRange() { return maRange; }
virtual void WriteToDocument( BOOL bSizeColsRows = FALSE,
- double nOutputFactor = 1.0 );
+ double nOutputFactor = 1.0,
-+ SvNumberFormatter* pFormatter = NULL );
++ SvNumberFormatter* pFormatter = NULL,
++ bool bConvertDate = true );
};
#endif
---- sc/source/filter/inc/ftools.hxx.old 2009-04-02 10:44:58.000000000 +0000
-+++ sc/source/filter/inc/ftools.hxx 2009-04-06 16:42:07.000000000 +0000
-@@ -522,7 +522,9 @@ class ScFormatFilterPluginImpl : public
+diff --git sc/source/filter/inc/ftools.hxx sc/source/filter/inc/ftools.hxx
+index b670900..79c698e 100644
+--- sc/source/filter/inc/ftools.hxx
++++ sc/source/filter/inc/ftools.hxx
+@@ -522,7 +522,9 @@ class ScFormatFilterPluginImpl : public ScFormatFilterPlugin {
virtual FltError ScImportDif( SvStream&, ScDocument*, const ScAddress& rInsPos,
const CharSet eSrc = RTL_TEXTENCODING_DONTKNOW, UINT32 nDifOption = SC_DIFOPT_EXCEL );
virtual FltError ScImportRTF( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange );
- virtual FltError ScImportHTML( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange, double nOutputFactor = 1.0, BOOL bCalcWidthHeight = TRUE );
+ virtual FltError ScImportHTML( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange,
+ double nOutputFactor = 1.0, BOOL bCalcWidthHeight = TRUE,
-+ SvNumberFormatter* pFormatter = NULL );
++ SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true );
virtual ScEEAbsImport *CreateRTFImport( ScDocument* pDoc, const ScRange& rRange );
virtual ScEEAbsImport *CreateHTMLImport( ScDocument* pDocP, const String& rBaseURL, const ScRange& rRange, BOOL bCalcWidthHeight );
---- sc/source/filter/inc/htmlimp.hxx.old 2009-04-02 10:44:58.000000000 +0000
-+++ sc/source/filter/inc/htmlimp.hxx 2009-04-06 16:42:07.000000000 +0000
-@@ -45,7 +45,7 @@ public:
+diff --git sc/source/filter/inc/htmlimp.hxx sc/source/filter/inc/htmlimp.hxx
+index 96ce225..aafe91b 100644
+--- sc/source/filter/inc/htmlimp.hxx
++++ sc/source/filter/inc/htmlimp.hxx
+@@ -45,7 +45,8 @@ public:
virtual ~ScHTMLImport();
const ScHTMLParser* GetParser() const { return (ScHTMLParser*)mpParser; }
- virtual void WriteToDocument( BOOL bSizeColsRows = FALSE, double nOutputFactor = 1.0 );
-+ virtual void WriteToDocument( BOOL bSizeColsRows = FALSE, double nOutputFactor = 1.0, SvNumberFormatter* pFormatter = NULL );
++ virtual void WriteToDocument( BOOL bSizeColsRows = FALSE, double nOutputFactor = 1.0,
++ SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true );
static String GetHTMLRangeNameList( ScDocument* pDoc, const String& rOrigName );
};
---- sc/source/filter/rtf/eeimpars.cxx.old 2009-04-02 10:44:58.000000000 +0000
-+++ sc/source/filter/rtf/eeimpars.cxx 2009-04-06 16:42:07.000000000 +0000
-@@ -129,7 +129,7 @@ ULONG ScEEImport::Read( SvStream& rStrea
+diff --git sc/source/filter/rtf/eeimpars.cxx sc/source/filter/rtf/eeimpars.cxx
+index 3f813a1..e4b28a7 100644
+--- sc/source/filter/rtf/eeimpars.cxx
++++ sc/source/filter/rtf/eeimpars.cxx
+@@ -129,7 +129,7 @@ ULONG ScEEImport::Read( SvStream& rStream, const String& rBaseURL )
}
-void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor )
-+void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor, SvNumberFormatter* pFormatter )
++void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor, SvNumberFormatter* pFormatter, bool bConvertDate )
{
ScProgress* pProgress = new ScProgress( mpDoc->GetDocumentShell(),
ScGlobal::GetRscString( STR_LOAD_DOC ), mpParser->Count() );
-@@ -150,7 +150,8 @@ void ScEEImport::WriteToDocument( BOOL b
+@@ -150,7 +150,8 @@ void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor )
nLastMergedRow = SCROW_MAX;
BOOL bHasGraphics = FALSE;
ScEEParseEntry* pE;
@@ -245,7 +436,7 @@
bool bNumbersEnglishUS = (pFormatter->GetLanguage() != LANGUAGE_ENGLISH_US);
if (bNumbersEnglishUS)
{
-@@ -335,7 +336,7 @@ void ScEEImport::WriteToDocument( BOOL b
+@@ -335,7 +336,7 @@ void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor )
else if ( !pE->aSel.HasRange() )
{
// maybe ALT text of IMG or similar
@@ -254,17 +445,19 @@
// wenn SelRange komplett leer kann nachfolgender Text im gleichen Absatz liegen!
}
else
-@@ -380,7 +381,7 @@ void ScEEImport::WriteToDocument( BOOL b
+@@ -380,7 +381,7 @@ void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor )
if (bNumbersEnglishUS && !bEnUsRecognized)
mpDoc->PutCell( nCol, nRow, nTab, new ScStringCell( aStr));
else
- mpDoc->SetString( nCol, nRow, nTab, aStr );
-+ mpDoc->SetString( nCol, nRow, nTab, aStr, pFormatter );
++ mpDoc->SetString( nCol, nRow, nTab, aStr, pFormatter, bConvertDate );
}
}
else
---- sc/source/ui/attrdlg/scdlgfact.cxx.old 2009-04-06 16:42:06.000000000 +0000
-+++ sc/source/ui/attrdlg/scdlgfact.cxx 2009-04-06 16:42:07.000000000 +0000
+diff --git sc/source/ui/attrdlg/scdlgfact.cxx sc/source/ui/attrdlg/scdlgfact.cxx
+index fe6cf52..0d1330e 100644
+--- sc/source/ui/attrdlg/scdlgfact.cxx
++++ sc/source/ui/attrdlg/scdlgfact.cxx
@@ -71,6 +71,7 @@
#include "validate.hxx" //add for ScValidationDlg
#include "validate.hrc" //add for ScValidationDlg
@@ -273,7 +466,7 @@
#include "opredlin.hxx" //add for ScRedlineOptionsTabPage
#include "tpcalc.hxx" //add for ScTpCalcOptions
#include "tpprint.hxx" //add for ScTpPrintOptions
-@@ -117,6 +118,7 @@ IMPL_ABSTDLG_BASE(AbstractScShowTabDlg_I
+@@ -117,6 +118,7 @@ IMPL_ABSTDLG_BASE(AbstractScShowTabDlg_Impl); //add for ScShowTabDlg
IMPL_ABSTDLG_BASE(AbstractScStringInputDlg_Impl); //add for ScStringInputDlg
IMPL_ABSTDLG_BASE(AbstractScTabBgColorDlg_Impl); //add for ScTabBgColorDlg
IMPL_ABSTDLG_BASE(AbstractScImportOptionsDlg_Impl); //add for ScImportOptionsDlg
@@ -281,7 +474,7 @@
IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl); //add for ScAttrDlg, ScHFEditDlg, ScStyleDlg, ScSubTotalDlg,ScCharDlg, ScParagraphDlg, ScValidationDlg, ScSortDlg
-@@ -594,6 +596,14 @@ void AbstractScImportOptionsDlg_Impl::Ge
+@@ -594,6 +596,20 @@ void AbstractScImportOptionsDlg_Impl::GetImportOptions( ScImportOptions& rOption
pDlg->GetImportOptions(rOptions);
}
// add for AbstractScImportOptionsDlg_Impl end
@@ -291,12 +484,18 @@
+{
+ return pDlg->getLanguageType();
+}
++
++bool AbstractScLangChooserDlg_Impl::IsDateConversionSet() const
++{
++ return pDlg->isDateConversionSet();
++}
++
+//add for AbstractScLangChooserDlg_Impl end
+
// =========================Factories for createdialog ===================
//add for ScImportAsciiDlg begin
-@@ -616,6 +626,21 @@ AbstractScImportAsciiDlg * ScAbstractDia
+@@ -616,6 +632,21 @@ AbstractScImportAsciiDlg * ScAbstractDialogFactory_Impl::CreateScImportAsciiDlg
}
// ScImportAsciiDlg end
@@ -318,8 +517,10 @@
//add for ScAutoFormatDlg begin
AbstractScAutoFormatDlg * ScAbstractDialogFactory_Impl::CreateScAutoFormatDlg( Window* pParent, //add for ScAutoFormatDlg
---- sc/source/ui/attrdlg/scdlgfact.hxx.old 2009-04-06 16:42:06.000000000 +0000
-+++ sc/source/ui/attrdlg/scdlgfact.hxx 2009-04-06 16:42:07.000000000 +0000
+diff --git sc/source/ui/attrdlg/scdlgfact.hxx sc/source/ui/attrdlg/scdlgfact.hxx
+index 4391001..4724771 100644
+--- sc/source/ui/attrdlg/scdlgfact.hxx
++++ sc/source/ui/attrdlg/scdlgfact.hxx
@@ -65,6 +65,7 @@ class ScStringInputDlg;
class ScTabBgColorDlg;
class ScImportOptionsDlg;
@@ -328,7 +529,7 @@
#define DECL_ABSTDLG_BASE(Class,DialogClass) \
DialogClass* pDlg; \
-@@ -356,6 +357,12 @@ class AbstractScImportOptionsDlg_Impl :
+@@ -356,6 +357,13 @@ class AbstractScImportOptionsDlg_Impl : public AbstractScImportOptionsDlg //add
virtual void GetImportOptions( ScImportOptions& rOptions ) const;
};
@@ -336,12 +537,13 @@
+{
+ DECL_ABSTDLG_BASE( AbstractScLangChooserDlg_Impl, ScLangChooserDlg)
+ virtual LanguageType GetLanguageType() const;
++ virtual bool IsDateConversionSet() const;
+};
+
//add for ScAttrDlg , ScHFEditDlg, ScStyleDlg, ScSubTotalDlg, ScCharDlg, ScParagraphDlg, ScValidationDlg, ScSortDlg
class AbstractTabDialog_Impl : public SfxAbstractTabDialog
{
-@@ -380,6 +387,8 @@ public:
+@@ -380,6 +388,8 @@ public:
SvStream* pInStream, int nId,
sal_Unicode cSep = '\t');
@@ -350,9 +552,12 @@
virtual AbstractScAutoFormatDlg * CreateScAutoFormatDlg( Window* pParent, //add for ScAutoFormatDlg
ScAutoFormat* pAutoFormat,
const ScAutoFormatData* pSelFormatData,
---- sc/source/ui/dbgui/langchooser.cxx.old 1970-01-01 00:00:00.000000000 +0000
-+++ sc/source/ui/dbgui/langchooser.cxx 2009-04-06 16:42:07.000000000 +0000
-@@ -0,0 +1,113 @@
+diff --git sc/source/ui/dbgui/langchooser.cxx sc/source/ui/dbgui/langchooser.cxx
+new file mode 100644
+index 0000000..d5fd72b
+--- /dev/null
++++ sc/source/ui/dbgui/langchooser.cxx
+@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -407,7 +612,9 @@
+ maFlChooseLang(this, ScResId(FL_CHOOSE_LANG)),
+ maRbAutomatic(this, ScResId(RB_AUTOMATIC)),
+ maRbCustom(this, ScResId(RB_CUSTOM)),
-+ maLbCustomLang(this, ScResId(LB_CUSTOM_LANG))
++ maLbCustomLang(this, ScResId(LB_CUSTOM_LANG)),
++ maFlOption(this, ScResId(FL_OPTION)),
++ maBtnConvertDate(this, ScResId(BTN_CONVERT_DATE))
+{
+ init();
+}
@@ -429,6 +636,11 @@
+ return maLbCustomLang.GetSelectLanguage();
+}
+
++bool ScLangChooserDlg::isDateConversionSet() const
++{
++ return maBtnConvertDate.IsChecked();
++}
++
+void ScLangChooserDlg::init()
+{
+ Link aLink = LINK( this, ScLangChooserDlg, OKHdl );
@@ -466,9 +678,12 @@
+ return 0;
+}
+
---- sc/source/ui/dbgui/langchooser.src.old 1970-01-01 00:00:00.000000000 +0000
-+++ sc/source/ui/dbgui/langchooser.src 2009-04-06 16:42:07.000000000 +0000
-@@ -0,0 +1,95 @@
+diff --git sc/source/ui/dbgui/langchooser.src sc/source/ui/dbgui/langchooser.src
+new file mode 100644
+index 0000000..1e121de
+--- /dev/null
++++ sc/source/ui/dbgui/langchooser.src
+@@ -0,0 +1,112 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -504,7 +719,7 @@
+ModalDialog RID_SCDLG_LANG_CHOOSER
+{
+ Text [ en-US ] = "Select Language" ;
-+ Size = MAP_APPFONT ( 190 , 70 ) ;
++ Size = MAP_APPFONT ( 190 , 101 ) ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ OutputSize = TRUE ;
@@ -562,10 +777,29 @@
+ DropDown = TRUE ;
+ Sort = TRUE ;
+ };
++
++ FixedLine FL_OPTION
++ {
++ Pos = MAP_APPFONT( 6, 70 );
++ Size = MAP_APPFONT( 125, 14 );
++
++ Text [ en-US ] = "Options" ;
++ };
++
++ CheckBox BTN_CONVERT_DATE
++ {
++ Pos = MAP_APPFONT( 12, 86 );
++ Size = MAP_APPFONT( 125, 10 );
++ TabStop = TRUE ;
++
++ Text [ en-US ] = "Detect special numbers (such as dates)." ;
++ };
+};
+
---- sc/source/ui/dbgui/makefile.mk.old 2009-04-02 10:45:25.000000000 +0000
-+++ sc/source/ui/dbgui/makefile.mk 2009-04-06 16:42:07.000000000 +0000
+diff --git sc/source/ui/dbgui/makefile.mk sc/source/ui/dbgui/makefile.mk
+index 0a95138..8df758d 100644
+--- sc/source/ui/dbgui/makefile.mk
++++ sc/source/ui/dbgui/makefile.mk
@@ -53,6 +53,7 @@ SLOFILES = \
$(SLO)$/pfiltdlg.obj \
$(SLO)$/dbnamdlg.obj \
@@ -592,20 +826,67 @@
# --- Tagets -------------------------------------------------------
---- sc/source/ui/docshell/docsh.cxx.old 2009-04-06 16:42:01.000000000 +0000
-+++ sc/source/ui/docshell/docsh.cxx 2009-04-06 16:42:07.000000000 +0000
-@@ -1273,12 +1273,23 @@ BOOL __EXPORT ScDocShell::ConvertFrom( S
+diff --git sc/source/ui/docshell/docsh.cxx sc/source/ui/docshell/docsh.cxx
+index 3dfbf19..66a91b8 100644
+--- sc/source/ui/docshell/docsh.cxx
++++ sc/source/ui/docshell/docsh.cxx
+@@ -137,6 +137,8 @@ using namespace com::sun::star;
+ using namespace com::sun::star::document::VbaEventId;
+
+ using namespace com::sun::star;
++using ::rtl::OUString;
++using ::rtl::OUStringBuffer;
+
+ // STATIC DATA -----------------------------------------------------------
+
+@@ -899,6 +901,34 @@ BOOL __EXPORT ScDocShell::LoadFrom( SfxMedium& rMedium )
+ return bRet;
+ }
+
++static void lcl_parseHtmlFilterOption(const OUString& rOption, LanguageType& rLang, bool& rDateConvert)
++{
++ OUStringBuffer aBuf;
++ OUString aTokens[2];
++ sal_Int32 n = rOption.getLength();
++ const sal_Unicode* p = rOption.getStr();
++ sal_Int32 nTokenId = 0;
++ for (sal_Int32 i = 0; i < n; ++i)
++ {
++ const sal_Unicode c = p[i];
++ if (c == sal_Unicode(' '))
++ {
++ if (aBuf.getLength())
++ aTokens[nTokenId++] = aBuf.makeStringAndClear();
++ }
++ else
++ aBuf.append(c);
++
++ if (nTokenId >= 2)
++ break;
++ }
++
++ if (aBuf.getLength())
++ aTokens[nTokenId] = aBuf.makeStringAndClear();
++
++ rLang = static_cast<LanguageType>(aTokens[0].toInt32());
++ rDateConvert = static_cast<bool>(aTokens[1].toInt32());
++}
+
+ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
+ {
+@@ -1273,12 +1303,24 @@ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
SvStream* pInStream = rMedium.GetInStream();
if (pInStream)
{
+ LanguageType eLang = LANGUAGE_SYSTEM;
++ bool bDateConvert = false;
+ SfxItemSet* pSet = rMedium.GetItemSet();
+ const SfxPoolItem* pItem;
+ if ( pSet && SFX_ITEM_SET ==
+ pSet->GetItemState( SID_FILE_FILTEROPTIONS, TRUE, &pItem ) )
+ {
+ String aFilterOption = (static_cast<const SfxStringItem*>(pItem))->GetValue();
-+ eLang = static_cast<LanguageType>(aFilterOption.ToInt32());
++ lcl_parseHtmlFilterOption(aFilterOption, eLang, bDateConvert);
+ }
+
pInStream->Seek( 0 );
@@ -615,24 +896,53 @@
+ SvNumberFormatter aNumFormatter(aDocument.GetServiceManager(), eLang);
eError = ScFormatFilter::Get().ScImportHTML( *pInStream, rMedium.GetBaseURL(), &aDocument, aRange,
- GetOutputFactor(), !bWebQuery );
-+ GetOutputFactor(), !bWebQuery, &aNumFormatter );
++ GetOutputFactor(), !bWebQuery, &aNumFormatter, bDateConvert );
if (eError != eERR_OK)
{
if (!GetError())
---- sc/source/ui/docshell/impex.cxx.old 2009-04-06 16:41:50.000000000 +0000
-+++ sc/source/ui/docshell/impex.cxx 2009-04-06 16:42:07.000000000 +0000
-@@ -1943,7 +1943,7 @@ class ScFormatFilterMissing : public ScF
+@@ -2266,6 +2308,11 @@ String ScDocShell::GetOwnFilterName() // static
+ return String::CreateFromAscii(pFilterSc50);
+ }
+
++String ScDocShell::GetHtmlFilterName()
++{
++ return String::CreateFromAscii(pFilterHtml);
++}
++
+ String ScDocShell::GetWebQueryFilterName() // static
+ {
+ return String::CreateFromAscii(pFilterHtmlWebQ);
+diff --git sc/source/ui/docshell/impex.cxx sc/source/ui/docshell/impex.cxx
+index cc51d67..e2ccdf5 100644
+--- sc/source/ui/docshell/impex.cxx
++++ sc/source/ui/docshell/impex.cxx
+@@ -1943,7 +1943,7 @@ class ScFormatFilterMissing : public ScFormatFilterPlugin {
virtual FltError ScImportDif( SvStream&, ScDocument*, const ScAddress&,
const CharSet, UINT32 ) RETURN_ERROR
virtual FltError ScImportRTF( SvStream&, const String&, ScDocument*, ScRange& ) RETURN_ERROR
- virtual FltError ScImportHTML( SvStream&, const String&, ScDocument*, ScRange&, double, BOOL ) RETURN_ERROR
-+ virtual FltError ScImportHTML( SvStream&, const String&, ScDocument*, ScRange&, double, BOOL, SvNumberFormatter* ) RETURN_ERROR
++ virtual FltError ScImportHTML( SvStream&, const String&, ScDocument*, ScRange&, double, BOOL, SvNumberFormatter*, bool ) RETURN_ERROR
virtual ScEEAbsImport *CreateRTFImport( ScDocument*, const ScRange& ) { return NULL; }
virtual ScEEAbsImport *CreateHTMLImport( ScDocument*, const String&, const ScRange&, BOOL ) { return NULL; }
---- sc/source/ui/inc/langchooser.hrc.old 1970-01-01 00:00:00.000000000 +0000
-+++ sc/source/ui/inc/langchooser.hrc 2009-04-06 16:42:07.000000000 +0000
-@@ -0,0 +1,41 @@
+diff --git sc/source/ui/inc/docsh.hxx sc/source/ui/inc/docsh.hxx
+index 1126a95..7620368 100644
+--- sc/source/ui/inc/docsh.hxx
++++ sc/source/ui/inc/docsh.hxx
+@@ -409,6 +409,7 @@ public:
+
+ static ScDocShell* GetShellByNum( USHORT nDocNo );
+ static String GetOwnFilterName();
++ static String GetHtmlFilterName();
+ static String GetWebQueryFilterName();
+ static String GetAsciiFilterName();
+ static String GetLotusFilterName();
+diff --git sc/source/ui/inc/langchooser.hrc sc/source/ui/inc/langchooser.hrc
+new file mode 100644
+index 0000000..eb981c1
+--- /dev/null
++++ sc/source/ui/inc/langchooser.hrc
+@@ -0,0 +1,42 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -673,10 +983,14 @@
+#define RB_AUTOMATIC 5
+#define RB_CUSTOM 6
+#define LB_CUSTOM_LANG 7
-+
---- sc/source/ui/inc/langchooser.hxx.old 1970-01-01 00:00:00.000000000 +0000
-+++ sc/source/ui/inc/langchooser.hxx 2009-04-06 16:42:07.000000000 +0000
-@@ -0,0 +1,73 @@
++#define FL_OPTION 8
++#define BTN_CONVERT_DATE 9
+diff --git sc/source/ui/inc/langchooser.hxx sc/source/ui/inc/langchooser.hxx
+new file mode 100644
+index 0000000..7106ab2
+--- /dev/null
++++ sc/source/ui/inc/langchooser.hxx
+@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -725,6 +1039,7 @@
+ virtual short Execute();
+
+ LanguageType getLanguageType() const;
++ bool isDateConversionSet() const;
+
+private:
+ void init();
@@ -741,7 +1056,9 @@
+
+ SvxLanguageBox maLbCustomLang;
+
-+ String maString;
++ FixedLine maFlOption;
++
++ CheckBox maBtnConvertDate;
+
+ DECL_LINK( OKHdl, OKButton* );
+
@@ -750,9 +1067,11 @@
+
+
+#endif
---- sc/source/ui/unoobj/filtuno.cxx.old 2009-04-02 10:45:26.000000000 +0000
-+++ sc/source/ui/unoobj/filtuno.cxx 2009-04-06 16:42:07.000000000 +0000
-@@ -51,6 +51,10 @@
+diff --git sc/source/ui/unoobj/filtuno.cxx sc/source/ui/unoobj/filtuno.cxx
+index 81efc76..406255e 100644
+--- sc/source/ui/unoobj/filtuno.cxx
++++ sc/source/ui/unoobj/filtuno.cxx
+@@ -51,7 +51,12 @@
#include "sc.hrc" //CHINA001
#include "scabstdlg.hxx" //CHINA001
@@ -761,9 +1080,11 @@
+#include <memory>
+
using namespace ::com::sun::star;
++using ::rtl::OUStringBuffer;
//------------------------------------------------------------------------
-@@ -146,6 +150,10 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::e
+
+@@ -146,6 +151,10 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException)
sal_Int16 nRet = ui::dialogs::ExecutableDialogResults::CANCEL;
String aFilterString( aFilterName );
@@ -774,7 +1095,7 @@
if ( !bExport && aFilterString == ScDocShell::GetAsciiFilterName() )
{
// ascii import is special...
-@@ -164,8 +172,6 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::e
+@@ -164,8 +173,6 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException)
pInStream = utl::UcbStreamHelper::CreateStream( xInputStream );
//CHINA001 ScImportAsciiDlg* pDlg = new ScImportAsciiDlg( NULL, aPrivDatName, pInStream, cAsciiDel );
@@ -783,11 +1104,11 @@
AbstractScImportAsciiDlg* pDlg = pFact->CreateScImportAsciiDlg( NULL, aPrivDatName, pInStream, RID_SCDLG_ASCII, cAsciiDel);
DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
if ( pDlg->Execute() == RET_OK )
-@@ -178,6 +184,19 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::e
+@@ -178,6 +185,24 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException)
delete pDlg;
delete pInStream;
}
-+ else if ( aFilterString == ScDocShell::GetWebQueryFilterName() )
++ else if ( aFilterString == ScDocShell::GetWebQueryFilterName() || aFilterString == ScDocShell::GetHtmlFilterName() )
+ {
+ // HTML import.
+ ::std::auto_ptr<AbstractScLangChooserDlg> pDlg(
@@ -796,14 +1117,19 @@
+ if (pDlg->Execute() == RET_OK)
+ {
+ LanguageType eLang = pDlg->GetLanguageType();
-+ aFilterOptions = String::CreateFromInt32(static_cast<sal_Int32>(eLang));
++ OUStringBuffer aBuf;
++
++ aBuf.append(String::CreateFromInt32(static_cast<sal_Int32>(eLang)));
++ aBuf.append(sal_Unicode(' '));
++ aBuf.append(pDlg->IsDateConversionSet() ? sal_Unicode('1') : sal_Unicode('0'));
++ aFilterOptions = aBuf.makeStringAndClear();
+ nRet = ui::dialogs::ExecutableDialogResults::OK;
+ }
+ }
else
{
sal_Bool bMultiByte = sal_True;
-@@ -249,8 +268,6 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::e
+@@ -249,8 +274,6 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException)
//CHINA001 &aOptions, &aTitle, bMultiByte, bDBEnc,
//CHINA001 !bExport );
//CHINA001
@@ -812,8 +1138,10 @@
AbstractScImportOptionsDlg* pDlg = pFact->CreateScImportOptionsDlg( NULL, RID_SCDLG_IMPORTOPT,
bAscii, &aOptions, &aTitle, bMultiByte, bDBEnc,
---- sc/util/makefile.mk.old 2009-04-06 16:42:06.000000000 +0000
-+++ sc/util/makefile.mk 2009-04-06 16:42:07.000000000 +0000
+diff --git sc/util/makefile.mk sc/util/makefile.mk
+index 855d560..0da917b 100644
+--- sc/util/makefile.mk
++++ sc/util/makefile.mk
@@ -281,6 +281,7 @@ LIB8OBJFILES = \
$(SLO)$/dapidata.obj \
$(SLO)$/crdlg.obj \
More information about the ooo-build-commit
mailing list