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:
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;
......
......@@ -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();
......
......@@ -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
......
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