[TD]Cleanup dead code in TaskRichAnno

This commit is contained in:
wandererfan
2020-01-14 19:43:21 -05:00
committed by WandererFan
parent 3af5139865
commit 6cb31ac91f
2 changed files with 8 additions and 22 deletions

View File

@@ -238,7 +238,14 @@ void TaskRichAnno::onEditorClicked(bool b)
Q_UNUSED(b);
m_textDialog = new QDialog(0);
QString leadText = ui->teAnnoText->toHtml();
m_rte = new MRichTextEdit(m_textDialog, leadText);
QString plainText = ui->teAnnoText->toPlainText();
// Base::Console().Message("TRA::onEditorClicked - leadText: %s** plainText: %s**\n",
// qPrintable(leadText), qPrintable(plainText));
if (plainText.isEmpty()) {
m_rte = new MRichTextEdit(m_textDialog);
} else {
m_rte = new MRichTextEdit(m_textDialog, leadText);
}
//m_rte->setTextWidth(m_annoVP->MaxWidth);
QGridLayout* gl = new QGridLayout(m_textDialog);
gl->addWidget(m_rte,0,0,1,1);
@@ -424,24 +431,6 @@ void TaskRichAnno::enableTaskButtons(bool b)
m_btnCancel->setEnabled(b);
}
QString TaskRichAnno::getDefFont(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Labels");
std::string fontName = hGrp->GetASCII("LabelFont", "osifont");
QString result = Base::Tools::fromStdString(fontName);
return result;
}
int TaskRichAnno::getDefFontSize()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Dimensions");
double fontSize = hGrp->GetFloat("FontSize", 5.0); // this is mm, not pts!
double mmToPts = 2.83;
int ptsSize = round(fontSize * mmToPts);
return ptsSize;
}
//******************************************************************************
bool TaskRichAnno::accept()

View File

@@ -100,9 +100,6 @@ protected:
void enableTextUi(bool b);
void enableVPUi(bool b);
int getDefFontSize(void);
QString getDefFont(void);
private:
Ui_TaskRichAnno * ui;
bool blockUpdate;