[Libreoffice-commits] .: 4 commits - sc/inc sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Mon Nov 15 11:41:54 PST 2010


 sc/inc/sc.hrc                     |   14 ++++++------
 sc/source/ui/miscdlgs/warnbox.cxx |   11 ++++++---
 sc/source/ui/src/scstring.src     |    5 ++++
 sc/source/ui/view/viewfun3.cxx    |   43 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 62 insertions(+), 11 deletions(-)

New commits:
commit aa8761169e0635ef42e08423d47eaa1692872c9a
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Mon Nov 15 14:39:27 2010 -0500

    Localize the warning string.

diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 49d14a2..c614e5e 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1368,17 +1368,17 @@
 
 // --------------------------------------------------
 
-#define SCSTR_HUMAN_SCDOC_NAME      (STR_START + 210)
-#define SCSTR_SHORT_SCDOC_NAME      (STR_START + 211)
-#define SCSTR_LONG_SCDOC_NAME       (STR_START + 212)
+#define SCSTR_HUMAN_SCDOC_NAME          (STR_START + 210)
+#define SCSTR_SHORT_SCDOC_NAME          (STR_START + 211)
+#define SCSTR_LONG_SCDOC_NAME           (STR_START + 212)
 
-#define SCSTR_CLPBRD_CLEAR			(STR_START + 213)
+#define SCSTR_CLPBRD_CLEAR			    (STR_START + 213)
 
 #define SCSTR_FORMULA_AUTOCORRECTION	(STR_START + 214)
 
-#define SCSTR_RENAMEOBJECT			(STR_START + 215)
-
-#define SCSTR_PRINT_OPTIONS     (STR_START+216)
+#define SCSTR_RENAMEOBJECT			    (STR_START + 215)
+#define SCSTR_PRINT_OPTIONS             (STR_START + 216)
+#define SCSTR_WARN_ME_IN_FUTURE_CHECK   (STR_START + 217)
 
 // Navigator - in der Reihenfolge wie SC_CONTENT_...
 #define SCSTR_CONTENT_ROOT		(STR_START + 250)
diff --git a/sc/source/ui/miscdlgs/warnbox.cxx b/sc/source/ui/miscdlgs/warnbox.cxx
index 0bc0b7c..5c36a35 100644
--- a/sc/source/ui/miscdlgs/warnbox.cxx
+++ b/sc/source/ui/miscdlgs/warnbox.cxx
@@ -41,8 +41,10 @@
 ScCbWarningBox::ScCbWarningBox( Window* pParent, const String& rMsgStr, bool bDefYes ) :
     WarningBox( pParent, WB_YES_NO | (bDefYes ? WB_DEF_YES : WB_DEF_NO), rMsgStr )
 {
+    // By default, the check box is ON, and the user needs to un-check it to
+    // disable all future warnings.
     SetCheckBoxState(true);
-    SetCheckBoxText(rtl::OUString::createFromAscii("Warn me every time."));
+    SetCheckBoxText(String(ScResId(SCSTR_WARN_ME_IN_FUTURE_CHECK)));
 }
 
 sal_Int16 ScCbWarningBox::Execute()
diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src
index f7c44c1..b4487b6 100644
--- a/sc/source/ui/src/scstring.src
+++ b/sc/source/ui/src/scstring.src
@@ -769,3 +769,8 @@ StringArray SCSTR_PRINT_OPTIONS
     };
 };
 
+String SCSTR_WARN_ME_IN_FUTURE_CHECK
+{
+    Text [ en-US ] = "Warn me about this in the future.";
+};
+
commit 2850857c0d23b9faee845642a2e8685c4e107814
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Mon Nov 15 13:31:32 2010 -0500

    Swap the check box logic, with an English checkbox message.

diff --git a/sc/source/ui/miscdlgs/warnbox.cxx b/sc/source/ui/miscdlgs/warnbox.cxx
index 60398a8..0bc0b7c 100644
--- a/sc/source/ui/miscdlgs/warnbox.cxx
+++ b/sc/source/ui/miscdlgs/warnbox.cxx
@@ -41,7 +41,8 @@
 ScCbWarningBox::ScCbWarningBox( Window* pParent, const String& rMsgStr, bool bDefYes ) :
     WarningBox( pParent, WB_YES_NO | (bDefYes ? WB_DEF_YES : WB_DEF_NO), rMsgStr )
 {
-    SetDefaultCheckBoxText();
+    SetCheckBoxState(true);
+    SetCheckBoxText(rtl::OUString::createFromAscii("Warn me every time."));
 }
 
 sal_Int16 ScCbWarningBox::Execute()
@@ -50,7 +51,7 @@ sal_Int16 ScCbWarningBox::Execute()
     if( IsDialogEnabled() )
     {
         nRet = WarningBox::Execute();
-        if( GetCheckBoxState() )
+        if (!GetCheckBoxState())
             DisableDialog();
     }
     return nRet;
commit e5fe2ea474997408416b3ae01eb268348bc369c4
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Mon Nov 15 10:56:19 2010 -0500

    Replaced BOOL with bool.

diff --git a/sc/source/ui/miscdlgs/warnbox.cxx b/sc/source/ui/miscdlgs/warnbox.cxx
index 4aeef57..60398a8 100644
--- a/sc/source/ui/miscdlgs/warnbox.cxx
+++ b/sc/source/ui/miscdlgs/warnbox.cxx
@@ -76,14 +76,14 @@ ScReplaceWarnBox::ScReplaceWarnBox( Window* pParent ) :
 
 bool ScReplaceWarnBox::IsDialogEnabled()
 {
-    return SC_MOD()->GetInputOptions().GetReplaceCellsWarn() == TRUE;
+    return SC_MOD()->GetInputOptions().GetReplaceCellsWarn() == true;
 }
 
 void ScReplaceWarnBox::DisableDialog()
 {
     ScModule* pScMod = SC_MOD();
     ScInputOptions aInputOpt( pScMod->GetInputOptions() );
-    aInputOpt.SetReplaceCellsWarn( FALSE );
+    aInputOpt.SetReplaceCellsWarn( false );
     pScMod->SetInputOptions( aInputOpt );
 }
 
commit a256e7bae190cdddcba720cc3b59647ca2d111f5
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Mon Nov 15 10:40:04 2010 -0500

    initial debug statement

diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index e374252..973fd20 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -215,6 +215,48 @@
 
 using namespace com::sun::star;
 
+#include <stdio.h>
+#include <string>
+#include <sys/time.h>
+
+namespace {
+
+class StackPrinter
+{
+public:
+    explicit StackPrinter(const char* msg) :
+        msMsg(msg)
+    {
+        fprintf(stdout, "%s: --begin\n", msMsg.c_str());
+        mfStartTime = getTime();
+    }
+
+    ~StackPrinter()
+    {
+        double fEndTime = getTime();
+        fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime));
+    }
+
+    void printTime(int line) const
+    {
+        double fEndTime = getTime();
+        fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime-mfStartTime));
+    }
+
+private:
+    double getTime() const
+    {
+        timeval tv;
+        gettimeofday(&tv, NULL);
+        return tv.tv_sec + tv.tv_usec / 1000000.0;
+    }
+
+    ::std::string msMsg;
+    double mfStartTime;
+};
+
+}
+
 // STATIC DATA ---------------------------------------------------------------
 
 
@@ -977,6 +1019,7 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
                                     InsCellCmd eMoveMode, USHORT nUndoExtraFlags,
                                     BOOL bAllowDialogs )
 {
+    StackPrinter __stack_printer__("ScViewFunc::PasteFromClip");
     if (!pClipDoc)
     {
         DBG_ERROR("PasteFromClip: pClipDoc=0 not allowed");


More information about the Libreoffice-commits mailing list