Kaydet (Commit) 1e6ad2af authored tarafından Markus Mohrhard's avatar Markus Mohrhard

ManageNames: restructure the code

move namepast.cxx to namedlg
namedefdlg is "modeless"(only in technical sense) and needs to be in sc
while namepast is modal and needs to be in scui
move the table implementation to an own file, we can reuse it for
namepast.cxx
üst 3224ddaf
......@@ -402,7 +402,9 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/ui/miscdlgs/solvrdlg \
sc/source/ui/miscdlgs/tabopdlg \
sc/source/ui/miscdlgs/warnbox \
sc/source/ui/namedlg/namedefdlg \
sc/source/ui/namedlg/namedlg \
sc/source/ui/namedlg/namemgrtable \
sc/source/ui/navipi/content \
sc/source/ui/navipi/navcitem \
sc/source/ui/navipi/navipi \
......
......@@ -94,13 +94,12 @@ $(eval $(call gb_Library_add_exception_objects,scui,\
sc/source/ui/miscdlgs/mtrindlg \
sc/source/ui/miscdlgs/mvtabdlg \
sc/source/ui/miscdlgs/namecrea \
sc/source/ui/miscdlgs/namepast \
sc/source/ui/miscdlgs/scuiautofmt \
sc/source/ui/miscdlgs/shtabdlg \
sc/source/ui/miscdlgs/strindlg \
sc/source/ui/miscdlgs/tabbgcolordlg \
sc/source/ui/miscdlgs/textdlgs \
sc/source/ui/namedlg/namedefdlg \
sc/source/ui/namedlg/namepast \
sc/source/ui/optdlg/opredlin \
sc/source/ui/optdlg/tpcalc \
sc/source/ui/optdlg/tpcompatibility \
......
......@@ -230,12 +230,8 @@ public:
class AbstractScNamePasteDlg : public VclAbstractDialog //add for ScNamePasteDlg
{
public:
virtual String GetSelectedName() const = 0;
};
class AbstractScNameAddDlg : public VclAbstractDialog // Define Name Dialog
{
public:
virtual std::vector<rtl::OUString> GetSelectedNames() const = 0;
virtual bool IsAllSelected() const = 0;
};
class AbstractScPivotFilterDlg : public VclAbstractDialog //add for ScPivotFilterDlg
......@@ -424,9 +420,6 @@ public:
virtual AbstractScNamePasteDlg * CreateScNamePasteDlg ( Window * pParent, const ScRangeName* pList, //add for ScNamePasteDlg
const ScRangeName* pLocalList, int nId , bool bInsList=true ) = 0;
virtual AbstractScNameAddDlg* CreateScNameAddDlg ( Window* pParent, ScDocument* pDoc, std::map<rtl::OUString, ScRangeName*> aRangeMap,
const ScAddress& aCursorPos, const bool bUndo, int nId) = 0;
virtual AbstractScPivotFilterDlg * CreateScPivotFilterDlg ( Window* pParent, //add for ScPivotFilterDlg
const SfxItemSet& rArgSet, sal_uInt16 nSourceTab , int nId ) = 0;
......
......@@ -107,7 +107,6 @@ IMPL_ABSTDLG_BASE(AbstractScMetricInputDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScMoveTableDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScNameCreateDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScNamePasteDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScNameAddDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScPivotFilterDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScDPFunctionDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScDPSubtotalDlg_Impl);
......@@ -508,12 +507,16 @@ sal_uInt16 AbstractScNameCreateDlg_Impl::GetFlags() const
String AbstractScNamePasteDlg_Impl::GetSelectedName() const
std::vector<rtl::OUString> AbstractScNamePasteDlg_Impl::GetSelectedNames() const
{
return pDlg->GetSelectedName();
return pDlg->GetSelectedNames();
}
bool AbstractScNamePasteDlg_Impl::IsAllSelected() const
{
return pDlg->IsAllSelected();
}
const ScQueryItem& AbstractScPivotFilterDlg_Impl::GetOutputItem()
......@@ -1152,23 +1155,6 @@ AbstractScNamePasteDlg * ScAbstractDialogFactory_Impl::CreateScNamePasteDlg ( Wi
}
AbstractScNameAddDlg* ScAbstractDialogFactory_Impl::CreateScNameAddDlg( Window* pParent, ScDocument* pDoc, std::map<rtl::OUString, ScRangeName*> aRangeMap, const ScAddress& aCursorPos, const bool bUndo, int nId)
{
ScNameDefDlg* pDlg = NULL;
switch ( nId )
{
case RID_SCDLG_NAMES_DEFINE :
pDlg = new ScNameDefDlg( pParent, pDoc, aRangeMap, aCursorPos, bUndo );
break;
default:
break;
}
if ( pDlg )
return new AbstractScNameAddDlg_Impl( pDlg );
return 0;
}
AbstractScPivotFilterDlg * ScAbstractDialogFactory_Impl::CreateScPivotFilterDlg ( Window* pParent,
const SfxItemSet& rArgSet, sal_uInt16 nSourceTab , int nId )
{
......
......@@ -283,12 +283,8 @@ class AbstractScNameCreateDlg_Impl : public AbstractScNameCreateDlg //add for S
class AbstractScNamePasteDlg_Impl : public AbstractScNamePasteDlg //add for ScNamePasteDlg
{
DECL_ABSTDLG_BASE( AbstractScNamePasteDlg_Impl, ScNamePasteDlg )
virtual String GetSelectedName() const;
};
class AbstractScNameAddDlg_Impl : public AbstractScNameAddDlg // Define Name
{
DECL_ABSTDLG_BASE( AbstractScNameAddDlg_Impl, ScNameDefDlg )
virtual std::vector<rtl::OUString> GetSelectedNames() const;
virtual bool IsAllSelected() const;
};
class AbstractScPivotFilterDlg_Impl : public AbstractScPivotFilterDlg //add for ScPivotFilterDlg
......@@ -492,9 +488,6 @@ public:
virtual AbstractScNamePasteDlg * CreateScNamePasteDlg ( Window * pParent, const ScRangeName* pList, //add for ScNamePasteDlg
const ScRangeName* pLocalList, int nId , bool bInsList=true );
virtual AbstractScNameAddDlg* CreateScNameAddDlg ( Window* pParent, ScDocument* pDoc, std::map<rtl::OUString, ScRangeName*> aRangeMap,
const ScAddress& aCursorPos, const bool bUndo, int nId);
virtual AbstractScPivotFilterDlg * CreateScPivotFilterDlg ( Window* pParent, //add for ScPivotFilterDlg
const SfxItemSet& rArgSet, sal_uInt16 nSourceTab , int nId );
......
......@@ -38,7 +38,7 @@
class ScRangeName;
class ScDocument;
class ScNameDefDlg : public ModalDialog
class ScNameDefDlg : public ScAnyRefDlg
{
private:
PushButton maBtnAdd;
......@@ -77,9 +77,10 @@ private:
DECL_LINK( AddBtnHdl, void* );
DECL_LINK( NameModifyHdl, void* );
public:
ScNameDefDlg(Window* pParent, ScDocument* pDoc, std::map<rtl::OUString, ScRangeName*> aRangeMap, const ScAddress& aCursorPos, const bool bUndo);
ScNameDefDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
ScDocument* pDoc, std::map<rtl::OUString, ScRangeName*> aRangeMap,
const ScAddress& aCursorPos, const bool bUndo);
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -35,10 +35,10 @@
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/ctrl.hxx>
#include <svtools/headbar.hxx>
#include <svtools/svtabbx.hxx>
#include "rangenam.hxx"
#include "anyrefdg.hxx"
#include "namemgrtable.hxx"
#include <boost/ptr_container/ptr_map.hpp>
#include <boost/ptr_container/ptr_set.hpp>
......@@ -48,35 +48,8 @@
class ScViewData;
class ScDocument;
struct ScNameDlgImpl;
struct ScRangeNameLine
{
rtl::OUString aName;
rtl::OUString aExpression;
rtl::OUString aScope;
};
//Implements the table for the manage names dialog
//TODO: cache the lines for performance improvements
//otherwise handling of a large set of range names might get extremely slow
//Need some sort of a filter to handle several range names
class ScRangeManagerTable : public SvTabListBox
{
private:
HeaderBar maHeaderBar;
ScRangeName* mpGlobalRangeName;
std::map<rtl::OUString, ScRangeName*> maTabRangeNames;
rtl::OUString maGlobalString;
public:
ScRangeManagerTable( Window* pParent, ScRangeName* pGlobalRangeName, std::map<rtl::OUString, ScRangeName*> aTabRangeNames );
~ScRangeManagerTable() {};
void addEntry( const ScRangeNameLine& rLine );
void GetCurrentLine(ScRangeNameLine& rLine);
void UpdateEntries();
};
class ScRangeManagerCtrl : public Control
{
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 Markus Mohrhard <markus.mohrhard@googlemail.com> (initial developer)
*
* 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.
*/
#include <svtools/headbar.hxx>
#include <svtools/svtabbx.hxx>
struct ScRangeNameLine
{
rtl::OUString aName;
rtl::OUString aExpression;
rtl::OUString aScope;
};
//Implements the table for the manage names dialog
//TODO: cache the lines for performance improvements
//otherwise handling of a large set of range names might get extremely slow
//Need some sort of a filter to handle several range names
SC_DLLPUBLIC class ScRangeManagerTable : public SvTabListBox
{
private:
HeaderBar maHeaderBar;
ScRangeName* mpGlobalRangeName;
std::map<rtl::OUString, ScRangeName*> maTabRangeNames;
rtl::OUString maGlobalString;
public:
ScRangeManagerTable( Window* pParent, ScRangeName* pGlobalRangeName, std::map<rtl::OUString, ScRangeName*> aTabRangeNames );
~ScRangeManagerTable() {};
void addEntry( const ScRangeNameLine& rLine );
void GetCurrentLine(ScRangeNameLine& rLine);
void UpdateEntries();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -34,6 +34,8 @@
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
#include <vector>
#include "scui_def.hxx"
class ScRangeName;
......@@ -53,7 +55,8 @@ protected:
public:
ScNamePasteDlg( Window * pParent, const ScRangeName* pList, const ScRangeName* pLocalList, bool bInsList=true );
String GetSelectedName() const;
std::vector<rtl::OUString> GetSelectedNames() const;
bool IsAllSelected() const;
};
......
......@@ -9,8 +9,10 @@
ScNameDefDlg::ScNameDefDlg( Window* pParent, ScDocument* pDoc, std::map<rtl::OUString, ScRangeName*> aRangeMap, const ScAddress& aCursorPos, const bool bUndo ) :
ModalDialog( pParent, ScResId( RID_SCDLG_NAMES_DEFINE) ),
ScNameDefDlg::ScNameDefDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
ScDocument* pDoc, std::map<rtl::OUString, ScRangeName*> aRangeMap,
const ScAddress& aCursorPos, const bool bUndo ) :
ScAnyRefDlg( pB, pCW, pParent, RID_SCDLG_NAMES_DEFINE ),
maBtnAdd( this, ScResId( BTN_ADD ) ),
maBtnCancel( this, ScResId( BTN_CANCEL ) ),
maFtInfo( this, ScResId( FT_INFO ) ),
......
......@@ -63,11 +63,7 @@ using ::std::auto_ptr;
#define ABS_SREF3D ABS_SREF | SCA_TAB_3D
#define ABS_DREF3D ABS_DREF | SCA_TAB_3D
//ScRangeManagerTable
#define ITEMID_NAME 1
#define ITEMID_RANGE 2
#define ITEMID_SCOPE 3
//helper
namespace {
......@@ -88,95 +84,6 @@ ScRangeName* GetRangeName(const rtl::OUString& rTableName, ScDocument* pDoc)
}
String createEntryString(const ScRangeNameLine& rLine)
{
String aRet(rLine.aName);
aRet += '\t';
aRet += String(rLine.aExpression);
aRet += '\t';
aRet += String(rLine.aScope);
return aRet;
}
ScRangeManagerTable::ScRangeManagerTable( Window* pWindow, ScRangeName* pGlobalRangeName, std::map<rtl::OUString, ScRangeName*> aTabRangeNames ):
SvTabListBox( pWindow, WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP ),
maHeaderBar( pWindow, WB_BUTTONSTYLE | WB_BOTTOMBORDER ),
mpGlobalRangeName( pGlobalRangeName ),
maTabRangeNames( aTabRangeNames ),
maGlobalString( ResId::toString(ScResId(STR_GLOBAL_SCOPE)))
{
Size aBoxSize( pWindow->GetOutputSizePixel() );
maHeaderBar.SetPosSizePixel( Point(0, 0), Size( aBoxSize.Width(), 16 ) );
String aNameStr(ScResId(STR_HEADER_NAME));
String aRangeStr(ScResId(STR_HEADER_RANGE));
String aScopeStr(ScResId(STR_HEADER_SCOPE));
long nTabSize = aBoxSize.Width()/3;
maHeaderBar.InsertItem( ITEMID_NAME, aNameStr, nTabSize, HIB_LEFT| HIB_VCENTER );
maHeaderBar.InsertItem( ITEMID_RANGE, aRangeStr, nTabSize, HIB_LEFT| HIB_VCENTER );
maHeaderBar.InsertItem( ITEMID_SCOPE, aScopeStr, nTabSize, HIB_LEFT| HIB_VCENTER );
static long nTabs[] = {3, 0, nTabSize, 2*nTabSize };
Size aHeadSize( maHeaderBar.GetSizePixel() );
//pParent->SetFocusControl( this );
SetPosSizePixel( Point( 0, aHeadSize.Height() ), Size( aBoxSize.Width(), aBoxSize.Height() - aHeadSize.Height() ) );
SetTabs( &nTabs[0], MAP_PIXEL );
Show();
maHeaderBar.Show();
}
void ScRangeManagerTable::addEntry(const ScRangeNameLine& rLine)
{
SvLBoxEntry* pEntry = InsertEntryToColumn( createEntryString(rLine), LIST_APPEND, 0xffff);
SetCurEntry(pEntry);
}
void ScRangeManagerTable::GetCurrentLine(ScRangeNameLine& rLine)
{
SvLBoxEntry* pCurrentEntry = GetCurEntry();
rLine.aName = GetEntryText( pCurrentEntry, 0);
rLine.aExpression = GetEntryText(pCurrentEntry, 1);
rLine.aScope = GetEntryText(pCurrentEntry, 2);
}
void ScRangeManagerTable::UpdateEntries()
{
Clear();
for (ScRangeName::iterator itr = mpGlobalRangeName->begin();
itr != mpGlobalRangeName->end(); ++itr)
{
if (!itr->HasType(RT_DATABASE) && !itr->HasType(RT_SHARED))
{
ScRangeNameLine aLine;
aLine.aName = itr->GetName();
aLine.aScope = maGlobalString;
itr->GetSymbol(aLine.aExpression);
addEntry(aLine);
}
}
for (std::map<rtl::OUString, ScRangeName*>::iterator itr = maTabRangeNames.begin();
itr != maTabRangeNames.end(); ++itr)
{
ScRangeName* pLocalRangeName = itr->second;
ScRangeNameLine aLine;
aLine.aScope = itr->first;
for (ScRangeName::iterator it = pLocalRangeName->begin();
it != pLocalRangeName->end(); ++it)
{
if (!it->HasType(RT_DATABASE) && !it->HasType(RT_SHARED))
{
aLine.aName = it->GetName();
it->GetSymbol(aLine.aExpression);
addEntry(aLine);
}
}
}
}
//logic
#define ERRORBOX(s) ErrorBox(this,WinBits(WB_OK|WB_DEF_OK),s).Execute();
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 Markus Mohrhard <markus.mohrhard@googlemail.com> (initial developer)
*
* 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.
*/
//ScRangeManagerTable
#include "global.hxx"
#include "reffact.hxx"
#include "document.hxx"
#include "docfunc.hxx"
#include "scresid.hxx"
#include "globstr.hrc"
#include "namedlg.hrc"
#include "namedlg.hxx"
#include "viewdata.hxx"
#include "sfx2/app.hxx"
#define ITEMID_NAME 1
#define ITEMID_RANGE 2
#define ITEMID_SCOPE 3
String createEntryString(const ScRangeNameLine& rLine)
{
String aRet(rLine.aName);
aRet += '\t';
aRet += String(rLine.aExpression);
aRet += '\t';
aRet += String(rLine.aScope);
return aRet;
}
ScRangeManagerTable::ScRangeManagerTable( Window* pWindow, ScRangeName* pGlobalRangeName, std::map<rtl::OUString, ScRangeName*> aTabRangeNames ):
SvTabListBox( pWindow, WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP ),
maHeaderBar( pWindow, WB_BUTTONSTYLE | WB_BOTTOMBORDER ),
mpGlobalRangeName( pGlobalRangeName ),
maTabRangeNames( aTabRangeNames ),
maGlobalString( ResId::toString(ScResId(STR_GLOBAL_SCOPE)))
{
Size aBoxSize( pWindow->GetOutputSizePixel() );
maHeaderBar.SetPosSizePixel( Point(0, 0), Size( aBoxSize.Width(), 16 ) );
String aNameStr(ScResId(STR_HEADER_NAME));
String aRangeStr(ScResId(STR_HEADER_RANGE));
String aScopeStr(ScResId(STR_HEADER_SCOPE));
long nTabSize = aBoxSize.Width()/3;
maHeaderBar.InsertItem( ITEMID_NAME, aNameStr, nTabSize, HIB_LEFT| HIB_VCENTER );
maHeaderBar.InsertItem( ITEMID_RANGE, aRangeStr, nTabSize, HIB_LEFT| HIB_VCENTER );
maHeaderBar.InsertItem( ITEMID_SCOPE, aScopeStr, nTabSize, HIB_LEFT| HIB_VCENTER );
static long nTabs[] = {3, 0, nTabSize, 2*nTabSize };
Size aHeadSize( maHeaderBar.GetSizePixel() );
//pParent->SetFocusControl( this );
SetPosSizePixel( Point( 0, aHeadSize.Height() ), Size( aBoxSize.Width(), aBoxSize.Height() - aHeadSize.Height() ) );
SetTabs( &nTabs[0], MAP_PIXEL );
Show();
maHeaderBar.Show();
}
void ScRangeManagerTable::addEntry(const ScRangeNameLine& rLine)
{
SvLBoxEntry* pEntry = InsertEntryToColumn( createEntryString(rLine), LIST_APPEND, 0xffff);
SetCurEntry(pEntry);
}
void ScRangeManagerTable::GetCurrentLine(ScRangeNameLine& rLine)
{
SvLBoxEntry* pCurrentEntry = GetCurEntry();
rLine.aName = GetEntryText( pCurrentEntry, 0);
rLine.aExpression = GetEntryText(pCurrentEntry, 1);
rLine.aScope = GetEntryText(pCurrentEntry, 2);
}
void ScRangeManagerTable::UpdateEntries()
{
Clear();
for (ScRangeName::iterator itr = mpGlobalRangeName->begin();
itr != mpGlobalRangeName->end(); ++itr)
{
if (!itr->HasType(RT_DATABASE) && !itr->HasType(RT_SHARED))
{
ScRangeNameLine aLine;
aLine.aName = itr->GetName();
aLine.aScope = maGlobalString;
itr->GetSymbol(aLine.aExpression);
addEntry(aLine);
}
}
for (std::map<rtl::OUString, ScRangeName*>::iterator itr = maTabRangeNames.begin();
itr != maTabRangeNames.end(); ++itr)
{
ScRangeName* pLocalRangeName = itr->second;
ScRangeNameLine aLine;
aLine.aScope = itr->first;
for (ScRangeName::iterator it = pLocalRangeName->begin();
it != pLocalRangeName->end(); ++it)
{
if (!it->HasType(RT_DATABASE) && !it->HasType(RT_SHARED))
{
aLine.aName = it->GetName();
it->GetSymbol(aLine.aExpression);
addEntry(aLine);
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -122,9 +122,16 @@ IMPL_LINK_INLINE_END( ScNamePasteDlg, ListDblClickHdl, ListBox *, pListBox )
//------------------------------------------------------------------
String ScNamePasteDlg::GetSelectedName() const
std::vector<rtl::OUString> ScNamePasteDlg::GetSelectedNames() const
{
return aNameList.GetSelectEntry();
std::vector<rtl::OUString> aSelectedNames;
aSelectedNames.push_back(aNameList.GetSelectEntry());
return aSelectedNames;
}
bool ScNamePasteDlg::IsAllSelected() const
{
return false;
}
......
......@@ -1828,8 +1828,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
// "=" in KeyEvent, switches to input-mode
pScMod->InputKeyEvent( KeyEvent('=',KeyCode()) );
String aName = pDlg->GetSelectedName();
pHdl->InsertFunction( aName, false ); // without "()"
std::vector<rtl::OUString> aNames = pDlg->GetSelectedNames();
pHdl->InsertFunction( aNames.at(0), false ); // without "()"
}
}
break;
......@@ -1838,21 +1838,6 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
}
break;
case FID_ADD_NAME:
{
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
std::cout << "Create Dialog in cellsh1.cxx" << std::endl;
ScDocument* pDoc = GetViewData()->GetDocument();
std::map<rtl::OUString, ScRangeName*> aRangeMap;
pDoc->GetRangeNameMap(aRangeMap);
ScAddress aPos( GetViewData()->GetCurX(), GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
AbstractScNameAddDlg* pDlg = pFact->CreateScNameAddDlg( pTabViewShell->GetDialogParent(), pDoc, aRangeMap, aPos, true, RID_SCDLG_NAMES_DEFINE );
pDlg->Execute();
delete pDlg;
}
break;
case SID_RANGE_NOTETEXT:
if (pReqArgs)
{
......
......@@ -94,6 +94,8 @@
#include "scui_def.hxx"
#include "scabstdlg.hxx"
#include <iostream>
using namespace ::com::sun::star;
......@@ -439,10 +441,10 @@ void ScEditShell::Execute( SfxRequest& rReq )
if ( nRet == BTN_PASTE_NAME )
{
String aName = pDlg->GetSelectedName();
pTableView->InsertText(aName);
std::vector<rtl::OUString> aNames = pDlg->GetSelectedNames();
pTableView->InsertText(aNames.at(0));
if (pTopView)
pTopView->InsertText(aName);
pTopView->InsertText(aNames.at(0));
}
delete pDlg;
......@@ -451,20 +453,6 @@ void ScEditShell::Execute( SfxRequest& rReq )
}
break;
case FID_ADD_NAME:
{
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
ScDocument* pDoc = pViewData->GetDocument();
std::map<rtl::OUString, ScRangeName*> aRangeMap;
pDoc->GetRangeNameMap(aRangeMap);
ScAddress aPos( pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo() );
AbstractScNameAddDlg* pDlg = pFact->CreateScNameAddDlg( pViewData->GetDialogParent(), pDoc, aRangeMap, aPos, true, RID_SCDLG_NAMES_DEFINE );
pDlg->Execute();
delete pDlg;
}
break;
case SID_CHAR_DLG:
{
SfxItemSet aAttrs( pTableView->GetAttribs() );
......
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