Kaydet (Commit) 63e3fb44 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

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

üst ac991693
/*
* 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@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
/*
* 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@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
...@@ -148,9 +148,10 @@ public: ...@@ -148,9 +148,10 @@ public:
const ScDragData& GetDragData() const; const ScDragData& GetDragData() const;
void SetDragObject( ScTransferObj* pCellObj, ScDrawTransferObj* pDrawObj ); void SetDragObject( ScTransferObj* pCellObj, ScDrawTransferObj* pDrawObj );
void ResetDragObject(); void ResetDragObject();
void SetDragLink( const String& rDoc, const String& rTab, const String& rArea ); void SetDragLink(
void SetDragJump( ScDocument* pLocalDoc, const rtl::OUString& rDoc, const rtl::OUString& rTab, const rtl::OUString& rArea );
const String& rTarget, const String& rText ); void SetDragJump(
ScDocument* pLocalDoc, const rtl::OUString& rTarget, const rtl::OUString& rText );
// clipboard: // clipboard:
const ScClipData& GetClipData() const; const ScClipData& GetClipData() const;
......
...@@ -658,13 +658,12 @@ void ScModule::ResetDragObject() ...@@ -658,13 +658,12 @@ void ScModule::ResetDragObject()
{ {
mpDragData->pCellTransfer = NULL; mpDragData->pCellTransfer = NULL;
mpDragData->pDrawTransfer = NULL; mpDragData->pDrawTransfer = NULL;
mpDragData->aLinkDoc.Erase();
mpDragData->aLinkTable.Erase();
mpDragData->aLinkArea.Erase();
mpDragData->pJumpLocalDoc = NULL; mpDragData->pJumpLocalDoc = NULL;
mpDragData->aJumpTarget.Erase(); mpDragData->aLinkDoc = rtl::OUString();
mpDragData->aJumpText.Erase(); mpDragData->aLinkTable = rtl::OUString();
mpDragData->aLinkArea = rtl::OUString();
mpDragData->aJumpTarget = rtl::OUString();
mpDragData->aJumpText = rtl::OUString();
} }
const ScDragData& ScModule::GetDragData() const const ScDragData& ScModule::GetDragData() const
...@@ -679,16 +678,17 @@ void ScModule::SetDragObject( ScTransferObj* pCellObj, ScDrawTransferObj* pDrawO ...@@ -679,16 +678,17 @@ void ScModule::SetDragObject( ScTransferObj* pCellObj, ScDrawTransferObj* pDrawO
mpDragData->pDrawTransfer = pDrawObj; 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(); ResetDragObject();
mpDragData->aLinkDoc = rDoc; mpDragData->aLinkDoc = rDoc;
mpDragData->aLinkTable = rTab; mpDragData->aLinkTable = rTab;
mpDragData->aLinkArea = rArea; 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(); ResetDragObject();
......
...@@ -3488,17 +3488,17 @@ sal_Int8 ScGridWindow::AcceptDrop( const AcceptDropEvent& rEvt ) ...@@ -3488,17 +3488,17 @@ sal_Int8 ScGridWindow::AcceptDrop( const AcceptDropEvent& rEvt )
} }
else else
{ {
if ( rData.aLinkDoc.Len() ) if ( !rData.aLinkDoc.isEmpty() )
{ {
String aThisName; rtl::OUString aThisName;
ScDocShell* pDocSh = pViewData->GetDocShell(); ScDocShell* pDocSh = pViewData->GetDocShell();
if (pDocSh && pDocSh->HasName()) if (pDocSh && pDocSh->HasName())
aThisName = pDocSh->GetMedium()->GetName(); aThisName = pDocSh->GetMedium()->GetName();
if ( rData.aLinkDoc != aThisName ) if ( !rData.aLinkDoc.equals(aThisName) )
nRet = rEvt.mnAction; nRet = rEvt.mnAction;
} }
else if (rData.aJumpTarget.Len()) else if (!rData.aJumpTarget.isEmpty())
{ {
// internal bookmarks (from Navigator) // internal bookmarks (from Navigator)
// local jumps from an unnamed document are possible only within a document // local jumps from an unnamed document are possible only within a document
...@@ -4097,25 +4097,25 @@ sal_Int8 ScGridWindow::ExecuteDrop( const ExecuteDropEvent& rEvt ) ...@@ -4097,25 +4097,25 @@ sal_Int8 ScGridWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
Point aPos = rEvt.maPosPixel; Point aPos = rEvt.maPosPixel;
if ( rData.aLinkDoc.Len() ) if ( !rData.aLinkDoc.isEmpty() )
{ {
// try to insert a link // try to insert a link
sal_Bool bOk = sal_True; bool bOk = true;
String aThisName; rtl::OUString aThisName;
ScDocShell* pDocSh = pViewData->GetDocShell(); ScDocShell* pDocSh = pViewData->GetDocShell();
if (pDocSh && pDocSh->HasName()) if (pDocSh && pDocSh->HasName())
aThisName = pDocSh->GetMedium()->GetName(); 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; bOk = false;
else else
{ {
ScViewFunc* pView = pViewData->GetView(); ScViewFunc* pView = pViewData->GetView();
if ( rData.aLinkTable.Len() ) if ( !rData.aLinkTable.isEmpty() )
pView->InsertTableLink( rData.aLinkDoc, EMPTY_STRING, EMPTY_STRING, pView->InsertTableLink( rData.aLinkDoc, EMPTY_STRING, EMPTY_STRING,
rData.aLinkTable ); rData.aLinkTable );
else if ( rData.aLinkArea.Len() ) else if ( !rData.aLinkArea.isEmpty() )
{ {
SCsCOL nPosX; SCsCOL nPosX;
SCsROW nPosY; SCsROW nPosY;
...@@ -4160,7 +4160,7 @@ sal_Int8 ScGridWindow::ExecuteDrop( const ExecuteDropEvent& rEvt ) ...@@ -4160,7 +4160,7 @@ sal_Int8 ScGridWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
SCsROW nPosY; SCsROW nPosY;
pViewData->GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY ); pViewData->GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
if (rData.aJumpTarget.Len()) if (!rData.aJumpTarget.isEmpty())
{ {
// internal bookmark (from Navigator) // internal bookmark (from Navigator)
// bookmark clipboard formats are in PasteScDataObject // bookmark clipboard formats are in PasteScDataObject
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment