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

Kohei Yoshida kohei at kemper.freedesktop.org
Mon Aug 29 18:00:20 PDT 2011


 sc/inc/clipdata.hxx           |   37 +++++++++++++++++++++++++++++++
 sc/inc/dragdata.hxx           |   50 ++++++++++++++++++++++++++++++++++++++++++
 sc/inc/scmod.hxx              |    7 +++--
 sc/source/ui/app/scmod.cxx    |   18 +++++++--------
 sc/source/ui/view/gridwin.cxx |   22 +++++++++---------
 5 files changed, 111 insertions(+), 23 deletions(-)

New commits:
commit 63e3fb44178f9e00c0e8d37c957fd55643fa9c4a
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Mon Aug 29 21:00:18 2011 -0400

    String to rtl::OUString, and I forgot to commit the new headers.

diff --git a/sc/inc/clipdata.hxx b/sc/inc/clipdata.hxx
new file mode 100644
index 0000000..823e398
--- /dev/null
+++ b/sc/inc/clipdata.hxx
@@ -0,0 +1,37 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 Kohei Yoshida <kohei.yoshida at suse.com> ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef __SC_CLIPDATA_HXX__
+#define __SC_CLIPDATA_HXX__
+
+struct ScClipData
+{
+    ScTransferObj*      pCellClipboard;
+    ScDrawTransferObj*  pDrawClipboard;
+};
+
+#endif
diff --git a/sc/inc/dragdata.hxx b/sc/inc/dragdata.hxx
new file mode 100644
index 0000000..f192c3f
--- /dev/null
+++ b/sc/inc/dragdata.hxx
@@ -0,0 +1,50 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 Kohei Yoshida <kohei.yoshida at suse.com> ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef __SC_DRAGDATA_HXX__
+#define __SC_DRAGDATA_HXX__
+
+#include "rtl/ustring.hxx"
+
+class ScTransferObj;
+class ScDrawTransferObj;
+class ScDocument;
+
+struct ScDragData
+{
+    ScTransferObj*      pCellTransfer;
+    ScDrawTransferObj*  pDrawTransfer;
+    ScDocument*         pJumpLocalDoc;
+
+    rtl::OUString       aLinkDoc;
+    rtl::OUString       aLinkTable;
+    rtl::OUString       aLinkArea;
+    rtl::OUString       aJumpTarget;
+    rtl::OUString       aJumpText;
+};
+
+#endif
diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx
index 7b8197a..2bc72fd 100644
--- a/sc/inc/scmod.hxx
+++ b/sc/inc/scmod.hxx
@@ -148,9 +148,10 @@ public:
     const ScDragData&   GetDragData() const;
     void                SetDragObject( ScTransferObj* pCellObj, ScDrawTransferObj* pDrawObj );
     void                ResetDragObject();
-    void                SetDragLink( const String& rDoc, const String& rTab, const String& rArea );
-    void                SetDragJump( ScDocument* pLocalDoc,
-                                    const String& rTarget, const String& rText );
+    void                SetDragLink(
+        const rtl::OUString& rDoc, const rtl::OUString& rTab, const rtl::OUString& rArea );
+    void                SetDragJump(
+        ScDocument* pLocalDoc, const rtl::OUString& rTarget, const rtl::OUString& rText );
 
     //  clipboard:
     const ScClipData&   GetClipData() const;
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 9b11fac..7932fca 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -658,13 +658,12 @@ void ScModule::ResetDragObject()
 {
     mpDragData->pCellTransfer = NULL;
     mpDragData->pDrawTransfer = NULL;
-
-    mpDragData->aLinkDoc.Erase();
-    mpDragData->aLinkTable.Erase();
-    mpDragData->aLinkArea.Erase();
     mpDragData->pJumpLocalDoc = NULL;
-    mpDragData->aJumpTarget.Erase();
-    mpDragData->aJumpText.Erase();
+    mpDragData->aLinkDoc = rtl::OUString();
+    mpDragData->aLinkTable = rtl::OUString();
+    mpDragData->aLinkArea = rtl::OUString();
+    mpDragData->aJumpTarget = rtl::OUString();
+    mpDragData->aJumpText = rtl::OUString();
 }
 
 const ScDragData& ScModule::GetDragData() const
@@ -679,16 +678,17 @@ void ScModule::SetDragObject( ScTransferObj* pCellObj, ScDrawTransferObj* pDrawO
     mpDragData->pDrawTransfer = pDrawObj;
 }
 
-void ScModule::SetDragLink( const String& rDoc, const String& rTab, const String& rArea )
+void ScModule::SetDragLink(
+    const rtl::OUString& rDoc, const rtl::OUString& rTab, const rtl::OUString& rArea )
 {
     ResetDragObject();
-
     mpDragData->aLinkDoc   = rDoc;
     mpDragData->aLinkTable = rTab;
     mpDragData->aLinkArea  = rArea;
 }
 
-void ScModule::SetDragJump( ScDocument* pLocalDoc, const String& rTarget, const String& rText )
+void ScModule::SetDragJump(
+    ScDocument* pLocalDoc, const rtl::OUString& rTarget, const rtl::OUString& rText )
 {
     ResetDragObject();
 
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index d87cc2e..305a68e 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -3488,17 +3488,17 @@ sal_Int8 ScGridWindow::AcceptDrop( const AcceptDropEvent& rEvt )
     }
     else
     {
-        if ( rData.aLinkDoc.Len() )
+        if ( !rData.aLinkDoc.isEmpty() )
         {
-            String aThisName;
+            rtl::OUString aThisName;
             ScDocShell* pDocSh = pViewData->GetDocShell();
             if (pDocSh && pDocSh->HasName())
                 aThisName = pDocSh->GetMedium()->GetName();
 
-            if ( rData.aLinkDoc != aThisName )
+            if ( !rData.aLinkDoc.equals(aThisName) )
                 nRet = rEvt.mnAction;
         }
-        else if (rData.aJumpTarget.Len())
+        else if (!rData.aJumpTarget.isEmpty())
         {
             //  internal bookmarks (from Navigator)
             //  local jumps from an unnamed document are possible only within a document
@@ -4097,25 +4097,25 @@ sal_Int8 ScGridWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
 
     Point aPos = rEvt.maPosPixel;
 
-    if ( rData.aLinkDoc.Len() )
+    if ( !rData.aLinkDoc.isEmpty() )
     {
         //  try to insert a link
 
-        sal_Bool bOk = sal_True;
-        String aThisName;
+        bool bOk = true;
+        rtl::OUString aThisName;
         ScDocShell* pDocSh = pViewData->GetDocShell();
         if (pDocSh && pDocSh->HasName())
             aThisName = pDocSh->GetMedium()->GetName();
 
-        if ( rData.aLinkDoc == aThisName )              // error - no link within a document
+        if ( rData.aLinkDoc.equals(aThisName) )              // error - no link within a document
             bOk = false;
         else
         {
             ScViewFunc* pView = pViewData->GetView();
-            if ( rData.aLinkTable.Len() )
+            if ( !rData.aLinkTable.isEmpty() )
                 pView->InsertTableLink( rData.aLinkDoc, EMPTY_STRING, EMPTY_STRING,
                                         rData.aLinkTable );
-            else if ( rData.aLinkArea.Len() )
+            else if ( !rData.aLinkArea.isEmpty() )
             {
                 SCsCOL  nPosX;
                 SCsROW  nPosY;
@@ -4160,7 +4160,7 @@ sal_Int8 ScGridWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
     SCsROW  nPosY;
     pViewData->GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
 
-    if (rData.aJumpTarget.Len())
+    if (!rData.aJumpTarget.isEmpty())
     {
         //  internal bookmark (from Navigator)
         //  bookmark clipboard formats are in PasteScDataObject


More information about the Libreoffice-commits mailing list