[ooo-build-commit] .: patches/dev300

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Oct 5 07:35:20 PDT 2010


 patches/dev300/apply                                            |    3 
 patches/dev300/calc-formula-variable-sep-config-check-sc.diff   |  301 ----------
 patches/dev300/calc-formula-variable-sep-config-check-sfx2.diff |  105 ---
 3 files changed, 409 deletions(-)

New commits:
commit 3b82afaf0206f7cc3a142a5ef4cb08267f80c39a
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue Oct 5 10:34:42 2010 -0400

    Removed calc-formula-variable-sep-config-check-*.diff; moved to git.

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 9e2f149..59d3186 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -2648,9 +2648,6 @@ crosswin32-writerperfect-cross.diff
 speed-sfx2-dont-throw-too-much.diff, i#107512, jholesov
 
 [ CalcFixes ]
-# Check for separator options' potential conflict with custom locale setting.
-calc-formula-variable-sep-config-check-sfx2.diff, n#556142, i#106959, kohei
-calc-formula-variable-sep-config-check-sc.diff,   n#556142, i#106959, kohei
 
 # Distributed text alignment support for cell text.
 calc-distributed-cell-text-cui.diff,     kohei
diff --git a/patches/dev300/calc-formula-variable-sep-config-check-sc.diff b/patches/dev300/calc-formula-variable-sep-config-check-sc.diff
deleted file mode 100644
index c23d036..0000000
--- a/patches/dev300/calc-formula-variable-sep-config-check-sc.diff
+++ /dev/null
@@ -1,301 +0,0 @@
- sc/inc/docoptio.hxx               |    3 +-
- sc/inc/globstr.hrc                |    4 +-
- sc/source/core/tool/docoptio.cxx  |  101 ++++++++++++++++++-------------------
- sc/source/ui/docshell/docsh6.cxx  |   71 ++++++++++++++++++++++++++
- sc/source/ui/docshell/makefile.mk |    1 +
- sc/source/ui/inc/docsh.hxx        |    2 +
- sc/source/ui/src/globstr.src      |    4 ++
- sc/source/ui/view/gridwin.cxx     |    1 +
- 9 files changed, 144 insertions(+), 83 deletions(-)
-
-diff --git sc/inc/docoptio.hxx sc/inc/docoptio.hxx
-index 8db36bd..458c68a 100644
---- sc/inc/docoptio.hxx
-+++ sc/inc/docoptio.hxx
-@@ -117,7 +117,8 @@ public:
-     void SetFormulaSepArrayCol(const ::rtl::OUString& rSep) { aFormulaSepArrayCol = rSep; }
-     ::rtl::OUString GetFormulaSepArrayCol() const { return aFormulaSepArrayCol; }
- 
--    const LocaleDataWrapper& GetLocaleDataWrapper() const;
-+    void ResetFormulaSeparators();
-+    static const LocaleDataWrapper& GetLocaleDataWrapper();
- };
- 
- 
-diff --git sc/inc/globstr.hrc sc/inc/globstr.hrc
-index 7503ce2..629cbb4 100644
---- sc/inc/globstr.hrc
-+++ sc/inc/globstr.hrc
-@@ -592,7 +592,9 @@
- #define STR_FORM_DROPDOWN           453
- #define STR_FORM_SPINNER            454
- #define STR_FORM_SCROLLBAR          455 
-+
-+#define STR_OPTIONS_WARN_SEPARATORS 456
- 
--#define STR_COUNT                       456
-+#define STR_COUNT                       457
- 
- #endif
-diff --git sc/source/core/tool/docoptio.cxx sc/source/core/tool/docoptio.cxx
-index fcb9a0d..b62650f 100644
---- sc/source/core/tool/docoptio.cxx
-+++ sc/source/core/tool/docoptio.cxx
-@@ -137,63 +137,62 @@ void ScDocOptions::ResetDocOptions()
-     bFormulaRegexEnabled= TRUE;
-     eFormulaGrammar     = ::formula::FormulaGrammar::GRAM_NATIVE;
- 
--    do
--    {
--        const Locale& rLocale = *ScGlobal::GetLocale();
--        const OUString& rLang = rLocale.Language;
--        if (rLang.equalsAscii("ru"))
--            // Don't do automatic guess for these languages, and fall back to
--            // the old separator set.
--            break;
--
--        const LocaleDataWrapper& rLocaleData = GetLocaleDataWrapper();
--        const OUString& rDecSep  = rLocaleData.getNumDecimalSep();
--        const OUString& rListSep = rLocaleData.getListSep();
--
--        if (!rDecSep.getLength() || !rListSep.getLength())
--            // Something is wrong.  Stick with the default separators.
--            break;
--
--        sal_Unicode cDecSep  = rDecSep.getStr()[0];
--        sal_Unicode cListSep = rListSep.getStr()[0];
--
--        // Excel by default uses system's list separator as the parameter
--        // separator, which in English locales is a comma.  However, OOo's list
--        // separator value is set to ';' for all English locales.  Because of this
--        // discrepancy, we will hardcode the separator value here, for now.
--        if (cDecSep == sal_Unicode('.'))
--            cListSep = sal_Unicode(',');
--
--        // Special case for de_CH locale.
--        if (rLocale.Language.equalsAsciiL("de", 2) && rLocale.Country.equalsAsciiL("CH", 2))
--            cListSep = sal_Unicode(';');
-+    ResetFormulaSeparators();
-+}
- 
--        // by default, the parameter separator equals the locale-specific
--        // list separator.
--        aFormulaSepArg = OUString(cListSep);
-+void ScDocOptions::ResetFormulaSeparators()
-+{
-+    // Defaults to the old separator values.
-+    aFormulaSepArg = OUString::createFromAscii(";");
-+    aFormulaSepArrayCol = OUString::createFromAscii(";");
-+    aFormulaSepArrayRow = OUString::createFromAscii("|");
- 
--        if (cDecSep == cListSep && cDecSep != sal_Unicode(';'))
--            // if the decimal and list separators are equal, set the
--            // parameter separator to be ';', unless they are both
--            // semicolon in which case don't change the decimal separator.
--            aFormulaSepArg = OUString::createFromAscii(";");
-+    const Locale& rLocale = *ScGlobal::GetLocale();
-+    const OUString& rLang = rLocale.Language;
-+    if (rLang.equalsAscii("ru"))
-+        // Don't do automatic guess for these languages, and fall back to
-+        // the old separator set.
-+        return;
- 
--        aFormulaSepArrayCol = OUString::createFromAscii(",");
--        if (cDecSep == sal_Unicode(','))
--            aFormulaSepArrayCol = OUString::createFromAscii(".");
--        aFormulaSepArrayRow = OUString::createFromAscii(";");
-+    const LocaleDataWrapper& rLocaleData = GetLocaleDataWrapper();
-+    const OUString& rDecSep  = rLocaleData.getNumDecimalSep();
-+    const OUString& rListSep = rLocaleData.getListSep();
- 
-+    if (!rDecSep.getLength() || !rListSep.getLength())
-+        // Something is wrong.  Stick with the default separators.
-         return;
--    }
--    while (false);
- 
--    // Defaults to the old separator values.
--    aFormulaSepArg      = OUString::createFromAscii(";");
--    aFormulaSepArrayCol = OUString::createFromAscii(";");
--    aFormulaSepArrayRow = OUString::createFromAscii("|");
-+    sal_Unicode cDecSep  = rDecSep.getStr()[0];
-+    sal_Unicode cListSep = rListSep.getStr()[0];
-+
-+    // Excel by default uses system's list separator as the parameter
-+    // separator, which in English locales is a comma.  However, OOo's list
-+    // separator value is set to ';' for all English locales.  Because of this
-+    // discrepancy, we will hardcode the separator value here, for now.
-+    if (cDecSep == sal_Unicode('.'))
-+        cListSep = sal_Unicode(',');
-+
-+    // Special case for de_CH locale.
-+    if (rLocale.Language.equalsAsciiL("de", 2) && rLocale.Country.equalsAsciiL("CH", 2))
-+        cListSep = sal_Unicode(';');
-+
-+    // by default, the parameter separator equals the locale-specific
-+    // list separator.
-+    aFormulaSepArg = OUString(cListSep);
-+
-+    if (cDecSep == cListSep && cDecSep != sal_Unicode(';'))
-+        // if the decimal and list separators are equal, set the
-+        // parameter separator to be ';', unless they are both
-+        // semicolon in which case don't change the decimal separator.
-+        aFormulaSepArg = OUString::createFromAscii(";");
-+
-+    aFormulaSepArrayCol = OUString::createFromAscii(",");
-+    if (cDecSep == sal_Unicode(','))
-+        aFormulaSepArrayCol = OUString::createFromAscii(".");
-+    aFormulaSepArrayRow = OUString::createFromAscii(";");
- }
- 
--const LocaleDataWrapper& ScDocOptions::GetLocaleDataWrapper() const
-+const LocaleDataWrapper& ScDocOptions::GetLocaleDataWrapper()
- {
-     return *ScGlobal::pLocaleData;
- }
-diff --git sc/source/ui/docshell/docsh6.cxx sc/source/ui/docshell/docsh6.cxx
-index 5c6a411..bb7b82f 100644
---- sc/source/ui/docshell/docsh6.cxx
-+++ sc/source/ui/docshell/docsh6.cxx
-@@ -53,6 +53,31 @@
- #include "tabvwsh.hxx"
- #include "tablink.hxx"
- #include "collect.hxx"
-+#include "docoptio.hxx"
-+#include "globstr.hrc"
-+#include "scmod.hxx"
-+
-+#include "formula/FormulaCompiler.hxx"
-+#include "comphelper/processfactory.hxx"
-+#include "vcl/msgbox.hxx"
-+
-+#include <com/sun/star/beans/XPropertySet.hpp>
-+#include <com/sun/star/container/XNameAccess.hpp>
-+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-+#include <com/sun/star/util/XChangesBatch.hpp>
-+
-+using ::com::sun::star::beans::XPropertySet;
-+using ::com::sun::star::lang::XMultiServiceFactory;
-+using ::com::sun::star::container::XNameAccess;
-+using ::com::sun::star::util::XChangesBatch;
-+using ::com::sun::star::uno::Any;
-+using ::com::sun::star::uno::Exception;
-+using ::com::sun::star::uno::Reference;
-+using ::com::sun::star::uno::Sequence;
-+using ::com::sun::star::uno::UNO_QUERY_THROW;
-+using ::rtl::OUString;
-+
-+namespace {
- 
- struct ScStylePair
- {
-@@ -60,6 +85,12 @@ struct ScStylePair
-     SfxStyleSheetBase *pDest;
- };
- 
-+inline OUString C2U(const char* s)
-+{
-+    return OUString::createFromAscii(s);
-+}
-+
-+}
- 
- // STATIC DATA -----------------------------------------------------------
- 
-@@ -466,4 +497,44 @@ BOOL ScDocShell::ReloadTabLinks()
-     return TRUE;		//! Fehler erkennen
- }
- 
-+void ScDocShell::CheckConfigOptions()
-+{
-+    if (IsConfigOptionsChecked())
-+        // no need to check repeatedly.
-+        return;
-+
-+    OUString aDecSep = ScGlobal::GetpLocaleData()->getNumDecimalSep();
-+
-+    ScModule* pScMod = SC_MOD();
-+    const ScDocOptions& rOpt = pScMod->GetDocOptions();
-+    OUString aSepArg = rOpt.GetFormulaSepArg();
-+    OUString aSepArrRow = rOpt.GetFormulaSepArrayRow();
-+    OUString aSepArrCol = rOpt.GetFormulaSepArrayCol();
-+
-+    if (aDecSep == aSepArg || aDecSep == aSepArrRow || aDecSep == aSepArrCol)
-+    {
-+        // One of arg separators conflicts with the current decimal
-+        // separator.  Reset them to default.
-+        ScDocOptions aNew = rOpt;
-+        aNew.ResetFormulaSeparators();
-+        aDocument.SetDocOptions(aNew);
-+        pScMod->SetDocOptions(aNew);
-+
-+        // Launch a nice warning dialog to let the users know of this change.
-+        ScTabViewShell* pViewShell = GetBestViewShell();
-+        if (pViewShell)
-+        {
-+            Window* pParent = pViewShell->GetFrameWin();
-+            InfoBox aBox(pParent, ScGlobal::GetRscString(STR_OPTIONS_WARN_SEPARATORS));
-+            aBox.Execute();
-+        }
-+
-+        // For now, this is the only option setting that could launch info
-+        // dialog.  But in the future we may want to implement a nicer
-+        // dialog to display a list of warnings in case we have several
-+        // pieces of information to display.
-+    }
-+
-+    SetConfigOptionsChecked(true);
-+}
- 
-diff --git sc/source/ui/docshell/makefile.mk sc/source/ui/docshell/makefile.mk
-index 6851f78..2f642b6 100644
---- sc/source/ui/docshell/makefile.mk
-+++ sc/source/ui/docshell/makefile.mk
-@@ -99,6 +99,7 @@ EXCEPTIONSFILES= \
-         $(SLO)$/docsh.obj \
-         $(SLO)$/docsh3.obj	\
-         $(SLO)$/docsh4.obj \
-+        $(SLO)$/docsh6.obj \
-         $(SLO)$/docsh8.obj \
-         $(SLO)$/externalrefmgr.obj \
-         $(SLO)$/dbdocimp.obj \
-diff --git sc/source/ui/inc/docsh.hxx sc/source/ui/inc/docsh.hxx
-index 95a16ed..1f0138e 100644
---- sc/source/ui/inc/docsh.hxx
-+++ sc/source/ui/inc/docsh.hxx
-@@ -327,6 +327,8 @@ public:
-     void			UpdateLinks();			// Link-Eintraege aktuallisieren
-     BOOL			ReloadTabLinks();		// Links ausfuehren (Inhalt aktualisieren)
- 
-+    virtual void    CheckConfigOptions();
-+
-     void            PostEditView( ScEditEngineDefaulter* pEditEngine, const ScAddress& rCursorPos );
- 
-     void            PostPaint( SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
-diff --git sc/source/ui/src/globstr.src sc/source/ui/src/globstr.src
-index eceefa6..5be3d92 100644
---- sc/source/ui/src/globstr.src
-+++ sc/source/ui/src/globstr.src
-@@ -1809,6 +1809,10 @@ Resource RID_GLOBSTR
-     {
-         Text [ en-US ] = "DataPilot table needs at least two rows of data to create or refresh." ;
-     };
-+    String STR_OPTIONS_WARN_SEPARATORS
-+    {
-+        Text [ en-US ] = "Because the current formula separator settings conflict with the locale, the formula separators have been reset to their default values.";
-+    };
-     String STR_UNDO_INSERT_CURRENT_DATE
-     {
-         Text [ en-US ] = "Insert Current Date";
-diff --git sc/source/ui/view/gridwin.cxx sc/source/ui/view/gridwin.cxx
-index 98a923a..b55baf5 100644
---- sc/source/ui/view/gridwin.cxx
-+++ sc/source/ui/view/gridwin.cxx
-@@ -4573,6 +4573,7 @@ void __EXPORT ScGridWindow::GetFocus()
-                             //		  auf dem Mac
-     }
- 
-+    pViewData->GetDocShell()->CheckConfigOptions();
-     Window::GetFocus();
- }
- 
diff --git a/patches/dev300/calc-formula-variable-sep-config-check-sfx2.diff b/patches/dev300/calc-formula-variable-sep-config-check-sfx2.diff
deleted file mode 100644
index a1183b8..0000000
--- a/patches/dev300/calc-formula-variable-sep-config-check-sfx2.diff
+++ /dev/null
@@ -1,105 +0,0 @@
----
- sfx2/inc/sfx2/objsh.hxx      |    7 +++++++
- sfx2/source/appl/appserv.cxx |    8 +++++++-
- sfx2/source/doc/objstor.cxx  |   16 ++++++++++++++++
- sfx2/source/doc/objxtor.cxx  |    1 +
- sfx2/source/inc/objshimp.hxx |    3 ++-
- 5 files changed, 33 insertions(+), 2 deletions(-)
-
-diff --git sfx2/inc/sfx2/objsh.hxx sfx2/inc/sfx2/objsh.hxx
-index ed0432a..26135a4 100644
---- sfx2/inc/sfx2/objsh.hxx
-+++ sfx2/inc/sfx2/objsh.hxx
-@@ -344,6 +344,13 @@ public:
-     virtual sal_Bool            SwitchPersistance(
-                                     const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
-     virtual void                UpdateLinks();
-+    /**
-+     * Called when the Options dialog is dismissed with the OK button, to
-+     * handle potentially conflicting option settings.
-+     */
-+    virtual void                CheckConfigOptions();
-+    sal_Bool                    IsConfigOptionsChecked() const;
-+    void                        SetConfigOptionsChecked( sal_Bool bChecked );
- 
-     // called for a few slots like SID_SAVE[AS]DOC, SID_PRINTDOC[DIRECT], derived classes may abort the action
-     virtual sal_Bool            QuerySlotExecutable( USHORT nSlotId );
-diff --git sfx2/source/appl/appserv.cxx sfx2/source/appl/appserv.cxx
-index e00f704..e1175c4 100644
---- sfx2/source/appl/appserv.cxx
-+++ sfx2/source/appl/appserv.cxx
-@@ -950,11 +950,17 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
-             {
-                 VclAbstractDialog* pDlg =
-                     pFact->CreateFrameDialog( NULL, xFrame, rReq.GetSlot(), sPageURL );
--                  pDlg->Execute();
-+                  short nRet = pDlg->Execute();
-                   delete pDlg;
-                 SfxViewFrame* pView = SfxViewFrame::GetFirst();
-                 while ( pView )
-                 {
-+                    if (nRet == RET_OK)
-+                    {
-+                        SfxObjectShell* pObjSh = pView->GetObjectShell();
-+                        if (pObjSh)
-+                            pObjSh->SetConfigOptionsChecked(false);
-+                    }
-                     pView->GetBindings().InvalidateAll(FALSE);
-                     pView = SfxViewFrame::GetNext( *pView );
-                 }
-diff --git sfx2/source/doc/objstor.cxx sfx2/source/doc/objstor.cxx
-index 3e0ed06..6128852 100644
---- sfx2/source/doc/objstor.cxx
-+++ sfx2/source/doc/objstor.cxx
-@@ -3966,6 +3966,22 @@ void SfxObjectShell::UpdateLinks()
- {
- }
- 
-+void SfxObjectShell::CheckConfigOptions()
-+{
-+    // not handled.  Each app's shell needs to overwrite this method to add handler.
-+    SetConfigOptionsChecked(true);
-+}
-+
-+sal_Bool SfxObjectShell::IsConfigOptionsChecked() const
-+{
-+    return pImp->m_bConfigOptionsChecked;
-+}
-+
-+void SfxObjectShell::SetConfigOptionsChecked( sal_Bool bChecked )
-+{
-+    pImp->m_bConfigOptionsChecked = bChecked;
-+}
-+
- sal_Bool SfxObjectShell::QuerySaveSizeExceededModules_Impl( const uno::Reference< task::XInteractionHandler >& xHandler )
- {
-     if ( !HasBasic() )
-diff --git sfx2/source/doc/objxtor.cxx sfx2/source/doc/objxtor.cxx
-index 8684942..980b224 100644
---- sfx2/source/doc/objxtor.cxx
-+++ sfx2/source/doc/objxtor.cxx
-@@ -225,6 +225,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
-     ,bSaveVersionOnClose( sal_False )
-     ,m_bSharedXMLFlag( sal_False )
-     ,m_bAllowShareControlFileClean( sal_True )
-+    ,m_bConfigOptionsChecked( sal_False )
-     ,lErr(ERRCODE_NONE)
-     ,nEventId ( 0)
-     ,pReloadTimer ( 0)
-diff --git sfx2/source/inc/objshimp.hxx sfx2/source/inc/objshimp.hxx
-index e022031..93cddc6 100644
---- sfx2/source/inc/objshimp.hxx
-+++ sfx2/source/inc/objshimp.hxx
-@@ -108,7 +108,8 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
-                         bUseUserData:1,
-                         bSaveVersionOnClose:1,
-                         m_bSharedXMLFlag:1, // whether the flag should be stored in xml file
--                        m_bAllowShareControlFileClean:1; // whether the flag should be stored in xml file
-+                        m_bAllowShareControlFileClean:1, // whether the flag should be stored in xml file
-+                        m_bConfigOptionsChecked:1; // whether or not the user options are checked after the Options dialog is closed.
- 
-     IndexBitSet         aBitSet;
-     sal_uInt32               lErr;
--- 
-1.7.0.1
-


More information about the ooo-build-commit mailing list