summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-11-23 03:02:01 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-11-23 06:25:35 +0100
commit1ca05c949702bc0fcaf8fce8c29c2ca7b8d42c6a (patch)
tree657f681eccac753e7ab3520d328f4d2d1376583c /sc/source
parent6f92d874d4273d6570631c929600777251782ffc (diff)
ManageNames: remove Add Button and debug output
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/namedlg/namedlg.cxx54
1 files changed, 4 insertions, 50 deletions
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index 5d436d3512d1..202eb82bf20b 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -135,7 +135,6 @@ void ScNameDlg::Init()
{
rtl::OUString aTemp(itr->first);
maRangeMap.insert(aTemp, new ScRangeName(*itr->second));
- std::cout << "RangeName: " << rtl::OUStringToOString(aTemp, RTL_TEXTENCODING_UTF8).getStr() << std::endl;
}
mpRangeManagerTable = new ScRangeManagerTable(&maNameMgrCtrl, maRangeMap);
@@ -178,6 +177,9 @@ void ScNameDlg::Init()
{
SelectionChanged();
}
+
+ //TODO: fix the Add Button
+ maBtnAdd.Disable();
}
sal_Bool ScNameDlg::IsRefInputMode() const
@@ -206,7 +208,6 @@ void ScNameDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
sal_Bool ScNameDlg::Close()
{
- std::cout << "Ok Pushed!" << std::endl;
ScDocFunc aFunc(*mpViewData->GetDocShell());
aFunc.ModifyAllRangeNames(maRangeMap);
return DoClose( ScNameDlgWrapper::GetChildWindowId() );
@@ -326,52 +327,7 @@ void ScNameDlg::ShowOptions(const ScRangeNameLine& rLine)
bool ScNameDlg::AddPushed()
{
- if (!mpDoc)
- return false;
-
- rtl::OUString aName = maEdName.GetText();
- aName = aName.trim();
- if (!aName.getLength())
- return false;
-
- if (!ScRangeData::IsNameValid( aName, mpDoc ))
- {
- ERRORBOX( ScGlobal::GetRscString(STR_INVALIDNAME));
- return false;
- }
-
- rtl::OUString aScope = maLbScope.GetSelectEntry();
- rtl::OUString aExpr = maEdAssign.GetText();
- ScRangeName* pRangeName = GetRangeName(aScope);
-
- RangeType nType = RT_NAME |
- (maBtnRowHeader.IsChecked() ? RT_ROWHEADER : RangeType(0))
- |(maBtnColHeader.IsChecked() ? RT_COLHEADER : RangeType(0))
- |(maBtnPrintArea.IsChecked() ? RT_PRINTAREA : RangeType(0))
- |(maBtnCriteria.IsChecked() ? RT_CRITERIA : RangeType(0));
-
- ScRangeData* pNewEntry = new ScRangeData( mpDoc, aName, aExpr,
- maCursorPos, nType);
- if ( 0 == pNewEntry->GetErrCode() )
- {
- if (!pRangeName->insert( pNewEntry))
- {
- pNewEntry = NULL;
- }
- else
- {
- maEdName.SetText(EMPTY_STRING);
- maBtnAdd.Disable();
- UpdateNames();
- SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
- }
- }
- else
- {
- delete pNewEntry;
- ERRORBOX( mErrMsgInvalidSym );
- }
- return true;
+ return false;
}
void ScNameDlg::RemovePushed()
@@ -381,8 +337,6 @@ void ScNameDlg::RemovePushed()
for (std::vector<ScRangeNameLine>::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
{
ScRangeName* pRangeName = GetRangeName(itr->aScope);
- std::cout << rtl::OUStringToOString(itr->aName, RTL_TEXTENCODING_UTF8).getStr() << std::endl;
- std::cout << rtl::OUStringToOString(ScGlobal::pCharClass->upper(itr->aName), RTL_TEXTENCODING_UTF8).getStr() << std::endl;;
ScRangeData* pData = pRangeName->findByUpperName(ScGlobal::pCharClass->upper(itr->aName));
OSL_ENSURE(pData, "table and model should be in sync");
// be safe and check for possible problems