Kaydet (Commit) f80c3e37 authored tarafından tagezi's avatar tagezi Kaydeden (comit) Mike Kaganski

tdf#91913 Saving line numbering into setting

It saves setting of the line numbering for next start
Now the line numbering is enabled by default

Change-Id: Ib658d417882996eb843fed9b236496fe2fb42166
Reviewed-on: https://gerrit.libreoffice.org/38013Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 3bdd04cd)
Reviewed-on: https://gerrit.libreoffice.org/38031
üst d0548cc4
......@@ -23,6 +23,7 @@
#include "iderdll.hxx"
#include "moduldlg.hxx"
#include "docsignature.hxx"
#include "officecfg/Office/BasicIDE.hxx"
#include "helpid.hrc"
#include <basidesh.hrc>
......@@ -172,10 +173,6 @@ void lcl_ConvertTabsToSpaces( OUString& rLine )
}
}
// until we have some configuration lets just keep
// persist this value for the process lifetime
bool bSourceLinesEnabled = false;
} // namespace
ModulWindow::ModulWindow (ModulWindowLayout* pParent, ScriptDocument const& rDocument,
......@@ -985,8 +982,12 @@ void ModulWindow::ExecuteCommand (SfxRequest& rReq)
case SID_SHOWLINES:
{
const SfxBoolItem* pItem = rReq.GetArg<SfxBoolItem>(rReq.GetSlot());
bSourceLinesEnabled = pItem && pItem->GetValue();
m_aXEditorWindow->SetLineNumberDisplay(bSourceLinesEnabled);
bool bLineNumbers = pItem && pItem->GetValue();
m_aXEditorWindow->SetLineNumberDisplay(bLineNumbers);
std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
officecfg::Office::BasicIDE::EditorSettings::LineNumbering::set(bLineNumbers, batch);
batch->commit();
}
break;
case SID_BASICIDE_DELETECURRENT:
......@@ -1121,7 +1122,8 @@ void ModulWindow::GetState( SfxItemSet &rSet )
break;
case SID_SHOWLINES:
{
rSet.Put(SfxBoolItem(nWh, bSourceLinesEnabled));
bool bLineNumbers = ::officecfg::Office::BasicIDE::EditorSettings::LineNumbering::get();
rSet.Put(SfxBoolItem(nWh, bLineNumbers));
break;
}
case SID_SELECTALL:
......@@ -1188,7 +1190,8 @@ void ModulWindow::AssertValidEditEngine()
void ModulWindow::Activating ()
{
m_aXEditorWindow->SetLineNumberDisplay(bSourceLinesEnabled);
bool bLineNumbers = ::officecfg::Office::BasicIDE::EditorSettings::LineNumbering::get();
m_aXEditorWindow->SetLineNumberDisplay(bLineNumbers);
Show();
}
......@@ -1370,7 +1373,8 @@ bool ModulWindow::IsPasteAllowed()
void ModulWindow::OnNewDocument ()
{
m_aXEditorWindow->SetLineNumberDisplay(bSourceLinesEnabled);
bool bLineNumbers = ::officecfg::Office::BasicIDE::EditorSettings::LineNumbering::get();
m_aXEditorWindow->SetLineNumberDisplay(bLineNumbers);
}
char const* ModulWindow::GetHid () const
......@@ -1566,7 +1570,6 @@ void ModulWindowLayout::SyntaxColors::NewConfig (bool bFirst)
pEditor->UpdateSyntaxHighlighting();
}
} // namespace basctl
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -63,5 +63,16 @@
<value>false</value>
</prop>
</group>
<group oor:name="EditorSettings">
<info>
<desc>Contains user configuration.</desc>
</info>
<prop oor:name="LineNumbering" oor:type="xs:boolean" oor:nillable="false">
<info>
<desc>Sets the line numbering on/off. Default is true.</desc>
</info>
<value>true</value>
</prop>
</group>
</component>
</oor:component-schema>
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