diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-18 10:29:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-18 15:22:40 +0200 |
commit | d7f2c36d25dd693ac4ac3ab645ee841e617d2bd1 (patch) | |
tree | 46516895aefcb6e8f54dd286c6af9d89fbecb44d | |
parent | 5d86154f49d713dada4aaa541755076cfeefa2c6 (diff) |
loplugin:unusedmethods
Change-Id: I5f63ac44654ed3fc658e72e0d1148a5a22decc47
Reviewed-on: https://gerrit.libreoffice.org/60662
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | compilerplugins/clang/unusedmethods.results | 118 | ||||
-rw-r--r-- | compilerplugins/clang/unusedmethods.unused-returns.results | 12 | ||||
-rw-r--r-- | i18npool/source/localedata/LocaleNode.cxx | 8 | ||||
-rw-r--r-- | i18npool/source/localedata/LocaleNode.hxx | 2 | ||||
-rw-r--r-- | include/svtools/ctrlbox.hxx | 11 | ||||
-rw-r--r-- | include/svx/SvxPresetListBox.hxx | 1 | ||||
-rw-r--r-- | include/svx/fntctrl.hxx | 3 | ||||
-rw-r--r-- | include/svx/langbox.hxx | 12 | ||||
-rw-r--r-- | include/vcl/field.hxx | 1 | ||||
-rw-r--r-- | svtools/source/control/ctrlbox.cxx | 156 | ||||
-rw-r--r-- | svx/source/dialog/fntctrl.cxx | 229 | ||||
-rw-r--r-- | svx/source/dialog/langbox.cxx | 72 | ||||
-rw-r--r-- | vcl/source/control/field.cxx | 5 |
13 files changed, 80 insertions, 550 deletions
diff --git a/compilerplugins/clang/unusedmethods.results b/compilerplugins/clang/unusedmethods.results index 1eda237006bc..1f9566a01400 100644 --- a/compilerplugins/clang/unusedmethods.results +++ b/compilerplugins/clang/unusedmethods.results @@ -46,8 +46,6 @@ connectivity/source/inc/OTypeInfo.hxx:46 _Bool connectivity::OTypeInfo::operator==(const struct connectivity::OTypeInfo &) const connectivity/source/inc/OTypeInfo.hxx:47 _Bool connectivity::OTypeInfo::operator!=(const struct connectivity::OTypeInfo &) const -cui/source/inc/numpages.hxx:62 - void SvxNumberingPreview::SetPositionMode() dbaccess/source/filter/hsqldb/fbalterparser.hxx:20 void dbahsql::FbAlterStmtParser::ensureProperTableLengths() const dbaccess/source/filter/hsqldb/parseschema.hxx:82 @@ -112,6 +110,10 @@ hwpfilter/source/mzstring.h:101 class MzString & MzString::operator<<(long) hwpfilter/source/mzstring.h:102 class MzString & MzString::operator<<(short) +i18npool/source/localedata/LocaleNode.hxx:78 + int Attr::getLength() const +i18npool/source/localedata/LocaleNode.hxx:79 + const class rtl::OUString & Attr::getTypeByIndex(int) const include/basegfx/color/bcolormodifier.hxx:76 _Bool basegfx::BColorModifier::operator!=(const class basegfx::BColorModifier &) const include/basegfx/curve/b2dcubicbezier.hxx:52 @@ -560,8 +562,20 @@ include/svl/itempool.hxx:196 void SfxItemPool::dumpAsXml(struct _xmlTextWriter *) const include/svtools/ctrlbox.hxx:208 long LineListBox::GetWidth() const -include/svtools/ctrlbox.hxx:220 - int LineListBox::GetEntryPos(enum SvxBorderLineStyle) const +include/svtools/ctrlbox.hxx:418 + void FontStyleBox::Fill(const class rtl::OUString &,const class FontList *) +include/svtools/ctrlbox.hxx:477 + void FontSizeBox::EnableRelativeMode(unsigned short,unsigned short,unsigned short) +include/svtools/ctrlbox.hxx:479 + void FontSizeBox::EnablePtRelativeMode(short,short,short) +include/svtools/ctrlbox.hxx:481 + _Bool FontSizeBox::IsRelativeMode() const +include/svtools/ctrlbox.hxx:483 + _Bool FontSizeBox::IsRelative() const +include/svtools/ctrlbox.hxx:484 + void FontSizeBox::SetPtRelative(_Bool) +include/svtools/ctrlbox.hxx:486 + _Bool FontSizeBox::IsPtRelative() const include/svtools/dialogcontrolling.hxx:167 void svt::ControlDependencyManager::enableOnCheckMark(class CheckBox &,class vcl::Window &,class vcl::Window &) include/svx/ClassificationEditView.hxx:42 @@ -572,18 +586,38 @@ include/svx/ClassificationField.hxx:48 const class rtl::OUString & svx::ClassificationResult::getDisplayText() const include/svx/ClassificationField.hxx:53 _Bool svx::ClassificationResult::operator==(const class svx::ClassificationResult &) const +include/svx/fntctrl.hxx:83 + void SvxFontPrevWindow::SetFromItemSet(const class SfxItemSet &,_Bool) include/svx/framelink.hxx:201 _Bool operator>(const class svx::frame::Style &,const class svx::frame::Style &) include/svx/framelink.hxx:238 _Bool svx::frame::StyleVectorCombination::operator<(const class svx::frame::StyleVectorCombination &) const +include/svx/langbox.hxx:85 + void SvxLanguageBoxBase::SetNoSelectionLBB() +include/svx/langbox.hxx:86 + void SvxLanguageBoxBase::HideLBB() +include/svx/langbox.hxx:87 + void SvxLanguageBoxBase::DisableLBB() +include/svx/langbox.hxx:88 + void SvxLanguageBoxBase::SaveValueLBB() +include/svx/langbox.hxx:89 + int SvxLanguageBoxBase::GetSelectedEntryPosLBB() const +include/svx/langbox.hxx:90 + void * SvxLanguageBoxBase::GetEntryDataLBB(int) const +include/svx/langbox.hxx:91 + int SvxLanguageBoxBase::GetSavedValueLBB() const +include/svx/langbox.hxx:209 + enum SvxLanguageComboBox::EditedAndValid SvxLanguageComboBox::GetEditedAndValid() const +include/svx/langbox.hxx:210 + int SvxLanguageComboBox::SaveEditedAsEntry() include/svx/svdlayer.hxx:75 _Bool SdrLayer::operator==(const class SdrLayer &) const include/svx/svdpage.hxx:105 class SdrModel & SdrObjList::getSdrModelFromSdrObjList() const include/svx/svdpntv.hxx:462 _Bool SdrPaintView::IsSwapAsynchron() const -include/svx/SvxPresetListBox.hxx:41 - void SvxPresetListBox::FillPresetListBoxImpl(type-parameter-?-? &,unsigned int) +include/svx/SvxPresetListBox.hxx:44 + const class Size & SvxPresetListBox::GetIconSize() const include/svx/xpoly.hxx:82 _Bool XPolygon::operator==(const class XPolygon &) const include/tools/bigint.hxx:86 @@ -674,6 +708,8 @@ include/vcl/errcode.hxx:89 _Bool ErrCode::operator>(const class ErrCode &) const include/vcl/errcode.hxx:90 _Bool ErrCode::operator>=(const class ErrCode &) const +include/vcl/field.hxx:157 + long NumericFormatter::GetSavedIntValue() const include/vcl/gdimtf.hxx:111 _Bool GDIMetaFile::operator!=(const class GDIMetaFile &) const include/vcl/gradient.hxx:104 @@ -754,43 +790,43 @@ include/vcl/weld.hxx:171 class rtl::OUString weld::Notebook::get_tab_label_text(const class rtl::OString &) const include/vcl/weld.hxx:197 struct SystemEnvData weld::Window::get_system_data() const -include/vcl/weld.hxx:333 +include/vcl/weld.hxx:347 void weld::TreeView::set_top_entry(int) -include/vcl/weld.hxx:359 +include/vcl/weld.hxx:373 void weld::TreeView::select_all() -include/vcl/weld.hxx:486 +include/vcl/weld.hxx:500 void weld::Entry::signal_insert_text(class rtl::OUString &) -include/vcl/weld.hxx:555 +include/vcl/weld.hxx:570 int weld::SpinButton::get_min() const -include/vcl/weld.hxx:737 +include/vcl/weld.hxx:832 void weld::MetricSpinButton::set_position(int) -include/vcl/weld.hxx:784 +include/vcl/weld.hxx:879 _Bool weld::TimeSpinButton::get_sensitive() const -include/vcl/weld.hxx:785 +include/vcl/weld.hxx:880 _Bool weld::TimeSpinButton::get_visible() const -include/vcl/weld.hxx:786 +include/vcl/weld.hxx:881 void weld::TimeSpinButton::grab_focus() -include/vcl/weld.hxx:787 +include/vcl/weld.hxx:882 _Bool weld::TimeSpinButton::has_focus() const -include/vcl/weld.hxx:788 +include/vcl/weld.hxx:883 void weld::TimeSpinButton::show(_Bool) -include/vcl/weld.hxx:789 +include/vcl/weld.hxx:884 void weld::TimeSpinButton::hide() -include/vcl/weld.hxx:790 +include/vcl/weld.hxx:885 void weld::TimeSpinButton::save_value() -include/vcl/weld.hxx:791 +include/vcl/weld.hxx:886 _Bool weld::TimeSpinButton::get_value_changed_from_saved() const -include/vcl/weld.hxx:882 +include/vcl/weld.hxx:977 void weld::DrawingArea::connect_key_release(const class Link<const class KeyEvent &, _Bool> &) -include/vcl/weld.hxx:935 +include/vcl/weld.hxx:1003 void weld::Menu::set_sensitive(const class rtl::OString &,_Bool) -include/vcl/weld.hxx:936 +include/vcl/weld.hxx:1004 void weld::Menu::set_active(const class rtl::OString &,_Bool) -include/vcl/weld.hxx:945 +include/vcl/weld.hxx:1013 void weld::SizeGroup::set_mode(enum VclSizeGroupMode) -include/vcl/weld.hxx:967 +include/vcl/weld.hxx:1035 class std::unique_ptr<class weld::Window, struct std::default_delete<class weld::Window> > weld::Builder::weld_window(const class rtl::OString &,_Bool) -include/vcl/weld.hxx:1078 +include/vcl/weld.hxx:1146 class rtl::OUString weld::MessageDialogController::get_primary_text() const include/vcl/window.hxx:430 const char * ImplDbgCheckWindow(const void *) @@ -876,13 +912,13 @@ sc/source/core/opencl/formulagroupcl.cxx:1260 _Bool sc::opencl::ParallelReductionVectorRef::GetEndFixed() const sc/source/core/opencl/op_statistical.hxx:204 sc::opencl::OpGeoMean::OpGeoMean() -sc/source/core/tool/scmatrix.cxx:2355 +sc/source/core/tool/scmatrix.cxx:2354 type-parameter-?-? * wrapped_iterator::operator->() const -sc/source/core/tool/scmatrix.cxx:3361 +sc/source/core/tool/scmatrix.cxx:3360 const class svl::SharedString & matop::COp::operator()(char,type-parameter-?-?,double,double,const class svl::SharedString &) const -sc/source/filter/inc/orcusinterface.hxx:79 +sc/source/filter/inc/orcusinterface.hxx:77 ScOrcusRefResolver::ScOrcusRefResolver(const class ScOrcusGlobalSettings &) -sc/source/filter/inc/tokstack.hxx:217 +sc/source/filter/inc/tokstack.hxx:214 _Bool TokenPool::GrowTripel(unsigned short) sc/source/filter/inc/xestream.hxx:107 class XclExpStream & XclExpStream::operator<<(float) @@ -1172,6 +1208,8 @@ vcl/inc/fontinstance.hxx:81 void LogicalFontInstance::ReleaseHbFont() vcl/inc/fontselect.hxx:49 _Bool FontSelectPattern::operator!=(const class FontSelectPattern &) const +vcl/inc/headless/svpgdi.hxx:245 + void SvpSalGraphics::drawBitmap(const struct SalTwoRect &,struct BitmapBuffer *,enum _cairo_operator) vcl/inc/impgraph.hxx:57 _Bool GraphicID::operator==(const class GraphicID &) const vcl/inc/opengl/BufferObject.hxx:50 @@ -1204,19 +1242,9 @@ vcl/inc/PhysicalFontFace.hxx:69 void PhysicalFontFace::SetBitmapSize(int,int) vcl/inc/PhysicalFontFamily.hxx:58 const class rtl::OUString & PhysicalFontFamily::GetAliasNames() const -vcl/inc/qt5/Qt5FilePicker.hxx:122 - void Qt5FilePicker::disposing(const struct com::sun::star::lang::EventObject &) -vcl/inc/qt5/Qt5FontFace.hxx:42 - int Qt5FontFace::GetFontTable(const char *,unsigned char *) const -vcl/inc/qt5/Qt5FontFace.hxx:46 - _Bool Qt5FontFace::HasChar(unsigned int) const -vcl/inc/qt5/Qt5Frame.hxx:91 - void Qt5Frame::TriggerPaintEvent(class QRect) -vcl/inc/qt5/Qt5Painter.hxx:56 - void Qt5Painter::update() vcl/inc/regionband.hxx:27 const char * ImplDbgTestRegionBand(const void *) -vcl/inc/salgdi.hxx:222 +vcl/inc/salgdi.hxx:217 class basegfx::B2DHomMatrix SalGraphics::mirror(const class basegfx::B2DHomMatrix &,const class OutputDevice *) const vcl/inc/salmenu.hxx:46 SalMenuButtonItem::SalMenuButtonItem() @@ -1240,6 +1268,12 @@ vcl/inc/unx/gtk/gtkdata.hxx:191 void GtkSalDisplay::RefreshMenusUnity() vcl/inc/unx/gtk/gtkinst.hxx:122 void GtkDropTarget::fire_dragExit(const struct com::sun::star::datatransfer::dnd::DropTargetEvent &) +vcl/inc/unx/saldata.hxx:68 + void X11SalData::initNWF() +vcl/inc/unx/saldisp.hxx:386 + class SalXLib * SalDisplay::GetXLib() const +vcl/inc/unx/salframe.h:187 + enum SalFrameStyleFlags X11SalFrame::GetStyle() const vcl/source/edit/textdat2.hxx:85 class __gnu_debug::_Safe_iterator<class __gnu_cxx::__normal_iterator<const class std::unique_ptr<class TETextPortion, struct std::default_delete<class TETextPortion> > *, class std::__cxx1998::vector<class std::unique_ptr<class TETextPortion, struct std::default_delete<class TETextPortion> >, class std::allocator<class std::unique_ptr<class TETextPortion, struct std::default_delete<class TETextPortion> > > > >, class std::__debug::vector<class std::unique_ptr<class TETextPortion, struct std::default_delete<class TETextPortion> >, class std::allocator<class std::unique_ptr<class TETextPortion, struct std::default_delete<class TETextPortion> > > > > TETextPortionList::begin() const vcl/source/edit/textdat2.hxx:87 @@ -1256,10 +1290,6 @@ vcl/source/fontsubset/xlat.hxx:34 unsigned short TranslateChar15(unsigned short) vcl/source/fontsubset/xlat.hxx:35 unsigned short TranslateChar16(unsigned short) -vcl/unx/kde4/KDE4FilePicker.hxx:137 - void KDE4FilePicker::disposing(const struct com::sun::star::lang::EventObject &) -vcl/unx/kde5/KDE5FilePicker.hxx:149 - void KDE5FilePicker::disposing(const struct com::sun::star::lang::EventObject &) workdir/LexTarget/l10ntools/source/cfglex.cxx:3721 void YYWarning(const char *) workdir/LexTarget/l10ntools/source/xrmlex.cxx:715 diff --git a/compilerplugins/clang/unusedmethods.unused-returns.results b/compilerplugins/clang/unusedmethods.unused-returns.results index cd74a8ba1912..cdd3fb074e7f 100644 --- a/compilerplugins/clang/unusedmethods.unused-returns.results +++ b/compilerplugins/clang/unusedmethods.unused-returns.results @@ -196,11 +196,9 @@ include/vcl/texteng.hxx:279 _Bool TextEngine::Read(class SvStream &,const class TextSelection *) include/vcl/toolbox.hxx:514 _Bool ToolBox::ChangeHighlightUpDn(_Bool) -include/vcl/weld.hxx:286 +include/vcl/weld.hxx:299 _Bool weld::ComboBoxText::get_entry_selection_bounds(int &,int &) -include/vcl/weld.hxx:495 - _Bool weld::Entry::get_selection_bounds(int &,int &) -include/vcl/weld.hxx:816 +include/vcl/weld.hxx:911 _Bool weld::TextView::get_selection_bounds(int &,int &) lotuswordpro/inc/lwpsvstream.hxx:76 class LwpSvStream & LwpSvStream::ReadUInt8(unsigned char &) @@ -308,12 +306,14 @@ vcl/inc/opengl/texture.hxx:112 _Bool OpenGLTexture::CopyData(int,int,int,int,const unsigned char *) vcl/inc/salframe.hxx:222 _Bool SalFrame::SetPluginParent(struct SystemParentData *) -vcl/inc/salgdi.hxx:219 +vcl/inc/salgdi.hxx:214 class basegfx::B2DPoint SalGraphics::mirror(const class basegfx::B2DPoint &,const class OutputDevice *) const -vcl/inc/salgdi.hxx:401 +vcl/inc/salgdi.hxx:397 _Bool SalGraphics::BlendBitmap(const struct SalTwoRect &,const class SalBitmap &,const class OutputDevice *) vcl/inc/unx/gtk/gtkdata.hxx:164 int GtkSalDisplay::CaptureMouse(class SalFrame *) +vcl/inc/unx/saldisp.hxx:316 + _Bool SalDisplay::Dispatch(union _XEvent *) vcl/source/gdi/pdfwriter_impl.hxx:1259 _Bool vcl::PDFWriterImpl::setCurrentStructureElement(int) vcl/source/gdi/pdfwriter_impl.hxx:1260 diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx index 37a732690d6d..ff384c394fcc 100644 --- a/i18npool/source/localedata/LocaleNode.cxx +++ b/i18npool/source/localedata/LocaleNode.cxx @@ -2311,14 +2311,6 @@ OUString Attr::getValueByName (const sal_Char *str) const { return OUString(); } -sal_Int32 Attr::getLength() const{ - return name.getLength(); -} - -const OUString& Attr::getTypeByIndex (sal_Int32 idx) const { - return name[idx]; -} - const OUString& Attr::getValueByIndex (sal_Int32 idx) const { return value[idx]; diff --git a/i18npool/source/localedata/LocaleNode.hxx b/i18npool/source/localedata/LocaleNode.hxx index ae32d30e7eea..7b19cbc82a73 100644 --- a/i18npool/source/localedata/LocaleNode.hxx +++ b/i18npool/source/localedata/LocaleNode.hxx @@ -75,8 +75,6 @@ class Attr { public: explicit Attr (const Reference< XAttributeList > & attr); OUString getValueByName (const sal_Char *str) const; - sal_Int32 getLength() const; - const OUString& getTypeByIndex (sal_Int32 idx) const; const OUString& getValueByIndex (sal_Int32 idx) const ; }; diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx index 535fa0859ccc..355fd44142a6 100644 --- a/include/svtools/ctrlbox.hxx +++ b/include/svtools/ctrlbox.hxx @@ -415,8 +415,6 @@ public: ComboBox::SetText( rText ); } - void Fill( const OUString& rName, const FontList* pList ); - private: FontStyleBox( const FontStyleBox& ) = delete; FontStyleBox& operator =( const FontStyleBox& ) = delete; @@ -474,16 +472,7 @@ public: void Fill( const FontMetric* pFontMetric, const FontList* pList ); - void EnableRelativeMode( sal_uInt16 nMin, sal_uInt16 nMax, - sal_uInt16 nStep = 5 ); - void EnablePtRelativeMode( short nMin, short nMax, - short nStep = 10 ); - bool IsRelativeMode() const { return bRelativeMode; } void SetRelative( bool bRelative ); - bool IsRelative() const { return bRelative; } - void SetPtRelative( bool bPtRel ) - { bPtRelative = bPtRel; SetRelative( true ); } - bool IsPtRelative() const { return bPtRelative; } virtual void SetValue( sal_Int64 nNewValue, FieldUnit eInUnit ) override; virtual void SetValue( sal_Int64 nNewValue ) override; diff --git a/include/svx/SvxPresetListBox.hxx b/include/svx/SvxPresetListBox.hxx index 8002d04a04f6..6ee305256225 100644 --- a/include/svx/SvxPresetListBox.hxx +++ b/include/svx/SvxPresetListBox.hxx @@ -41,7 +41,6 @@ public: virtual void Resize() override; virtual void Command( const CommandEvent& rEvt ) override; sal_uInt32 getColumnCount() const { return nColCount; } - Size const & GetIconSize() const { return aIconSize; } void DrawLayout(); }; diff --git a/include/svx/fntctrl.hxx b/include/svx/fntctrl.hxx index a3d00a3d9a01..c122c98943d6 100644 --- a/include/svx/fntctrl.hxx +++ b/include/svx/fntctrl.hxx @@ -80,9 +80,6 @@ public: void SetFontWidthScale( const SfxItemSet& rSet ); void SetFontEscapement( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc ); - void SetFromItemSet( const SfxItemSet &rSet, - bool bPreviewBackgroundToCharacter ); - virtual Size GetOptimalSize() const override; }; diff --git a/include/svx/langbox.hxx b/include/svx/langbox.hxx index 2dabd4112a24..c6ee96c36ab9 100644 --- a/include/svx/langbox.hxx +++ b/include/svx/langbox.hxx @@ -82,14 +82,6 @@ public: LanguageType GetSelectedLanguage() const; bool IsLanguageSelected( const LanguageType eLangType ) const; - void SetNoSelectionLBB(); - void HideLBB(); - void DisableLBB(); - void SaveValueLBB(); - sal_Int32 GetSelectedEntryPosLBB() const; - void* GetEntryDataLBB( sal_Int32 nPos ) const; - sal_Int32 GetSavedValueLBB() const; - protected: Image m_aNotCheckedImage; Image m_aCheckedImage; @@ -206,10 +198,6 @@ public: Invalid }; - EditedAndValid GetEditedAndValid() const { return meEditedAndValid;} - sal_Int32 SaveEditedAsEntry(); - - private: sal_Int32 mnSavedValuePos; EditedAndValid meEditedAndValid; diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx index 1856bcefc649..18c099364408 100644 --- a/include/vcl/field.hxx +++ b/include/vcl/field.hxx @@ -154,7 +154,6 @@ public: void SetUserValue( sal_Int64 nNewValue ); virtual void SetValue( sal_Int64 nNewValue ); sal_Int64 GetValue() const; - sal_Int64 GetSavedIntValue() const; virtual OUString CreateFieldText( sal_Int64 nValue ) const; bool IsValueModified() const; diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 432663803437..1ff8801d316a 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1083,144 +1083,6 @@ void FontStyleBox::Modify() ComboBox::Modify(); } -void FontStyleBox::Fill( const OUString& rName, const FontList* pList ) -{ - // note: this method must call ComboBox::SetText(), - // else aLastStyle will overwritten - // store prior selection position and clear box - OUString aOldText = GetText(); - sal_Int32 nPos = GetEntryPos( aOldText ); - Clear(); - - // does a font with this name already exist? - sal_Handle hFontMetric = pList->GetFirstFontMetric( rName ); - if ( hFontMetric ) - { - OUString aStyleText; - FontWeight eLastWeight = WEIGHT_DONTKNOW; - FontItalic eLastItalic = ITALIC_NONE; - FontWidth eLastWidth = WIDTH_DONTKNOW; - bool bNormal = false; - bool bItalic = false; - bool bBold = false; - bool bBoldItalic = false; - bool bInsert = false; - FontMetric aFontMetric; - while ( hFontMetric ) - { - aFontMetric = FontList::GetFontMetric( hFontMetric ); - - FontWeight eWeight = aFontMetric.GetWeight(); - FontItalic eItalic = aFontMetric.GetItalic(); - FontWidth eWidth = aFontMetric.GetWidthType(); - // Only if the attributes are different, we insert the - // Font to avoid double Entries in different languages - if ( (eWeight != eLastWeight) || (eItalic != eLastItalic) || - (eWidth != eLastWidth) ) - { - if ( bInsert ) - InsertEntry( aStyleText ); - - if ( eWeight <= WEIGHT_NORMAL ) - { - if ( eItalic != ITALIC_NONE ) - bItalic = true; - else - bNormal = true; - } - else - { - if ( eItalic != ITALIC_NONE ) - bBoldItalic = true; - else - bBold = true; - } - - // For wrong StyleNames we replace this with the correct once - aStyleText = pList->GetStyleName( aFontMetric ); - bInsert = GetEntryPos( aStyleText ) == LISTBOX_ENTRY_NOTFOUND; - if ( !bInsert ) - { - aStyleText = pList->GetStyleName( eWeight, eItalic ); - bInsert = GetEntryPos( aStyleText ) == LISTBOX_ENTRY_NOTFOUND; - } - - eLastWeight = eWeight; - eLastItalic = eItalic; - eLastWidth = eWidth; - } - else - { - if ( bInsert ) - { - // If we have two names for the same attributes - // we prefer the translated standard names - const OUString& rAttrStyleText = pList->GetStyleName( eWeight, eItalic ); - if (rAttrStyleText != aStyleText) - { - OUString aTempStyleText = pList->GetStyleName( aFontMetric ); - if (rAttrStyleText == aTempStyleText) - aStyleText = rAttrStyleText; - bInsert = GetEntryPos( aStyleText ) == LISTBOX_ENTRY_NOTFOUND; - } - } - } - - if ( !bItalic && (aStyleText == pList->GetItalicStr()) ) - bItalic = true; - else if ( !bBold && (aStyleText == pList->GetBoldStr()) ) - bBold = true; - else if ( !bBoldItalic && (aStyleText == pList->GetBoldItalicStr()) ) - bBoldItalic = true; - - hFontMetric = FontList::GetNextFontMetric( hFontMetric ); - } - - if ( bInsert ) - InsertEntry( aStyleText ); - - // certain style as copy - if ( bNormal ) - { - if ( !bItalic ) - InsertEntry( pList->GetItalicStr() ); - if ( !bBold ) - InsertEntry( pList->GetBoldStr() ); - } - if ( !bBoldItalic ) - { - if ( bNormal || bItalic || bBold ) - InsertEntry( pList->GetBoldItalicStr() ); - } - if (!aOldText.isEmpty()) - { - if ( GetEntryPos( aLastStyle ) != LISTBOX_ENTRY_NOTFOUND ) - ComboBox::SetText( aLastStyle ); - else - { - if ( nPos >= GetEntryCount() ) - ComboBox::SetText( GetEntry( 0 ) ); - else - ComboBox::SetText( GetEntry( nPos ) ); - } - } - } - else - { - // insert standard styles if no font - InsertEntry( pList->GetNormalStr() ); - InsertEntry( pList->GetItalicStr() ); - InsertEntry( pList->GetBoldStr() ); - InsertEntry( pList->GetBoldItalicStr() ); - if (!aOldText.isEmpty()) - { - if ( nPos > GetEntryCount() ) - ComboBox::SetText( GetEntry( 0 ) ); - else - ComboBox::SetText( GetEntry( nPos ) ); - } - } -} SvtFontStyleBox::SvtFontStyleBox(std::unique_ptr<weld::ComboBox> p) : m_xComboBox(std::move(p)) @@ -1568,24 +1430,6 @@ void FontSizeBox::Fill( const FontMetric* pFontMetric, const FontList* pList ) SetSelection( aSelection ); } -void FontSizeBox::EnableRelativeMode( sal_uInt16 nMin, sal_uInt16 nMax, sal_uInt16 nStep ) -{ - bRelativeMode = true; - nRelMin = nMin; - nRelMax = nMax; - nRelStep = nStep; - SetUnit( FUNIT_POINT ); -} - -void FontSizeBox::EnablePtRelativeMode( short nMin, short nMax, short nStep ) -{ - bRelativeMode = true; - nPtRelMin = nMin; - nPtRelMax = nMax; - nPtRelStep = nStep; - SetUnit( FUNIT_POINT ); -} - void FontSizeBox::SetRelative( bool bNewRelative ) { if ( !bRelativeMode ) diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index e955713f2d50..b1a14c7961b2 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -910,235 +910,6 @@ static void SetPrevFontEscapement(SvxFont& rFont, sal_uInt8 nProp, sal_uInt8 nEs rFont.SetEscapement(nEsc); } -void SvxFontPrevWindow::SetFromItemSet(const SfxItemSet &rSet, bool bPreviewBackgroundToCharacter) -{ - sal_uInt16 nWhich; - SvxFont& rFont = GetFont(); - SvxFont& rCJKFont = GetCJKFont(); - SvxFont& rCTLFont = GetCTLFont(); - - // Preview string - if( GetWhich( rSet, SID_CHAR_DLG_PREVIEW_STRING, nWhich ) ) - { - const SfxStringItem& rItem = static_cast<const SfxStringItem&>( rSet.Get( nWhich ) ); - const OUString& aString = rItem.GetValue(); - if( !aString.isEmpty() ) - SetPreviewText( aString ); - else - SetFontNameAsPreviewText(); - } - - // Underline - FontLineStyle eUnderline; - if( GetWhich( rSet, SID_ATTR_CHAR_UNDERLINE, nWhich ) ) - { - const SvxUnderlineItem& rItem = static_cast<const SvxUnderlineItem&>( rSet.Get( nWhich ) ); - eUnderline = rItem.GetValue(); - SetTextLineColor( rItem.GetColor() ); - } - else - eUnderline = LINESTYLE_NONE; - - rFont.SetUnderline( eUnderline ); - rCJKFont.SetUnderline( eUnderline ); - rCTLFont.SetUnderline( eUnderline ); - - // Overline - FontLineStyle eOverline; - if( GetWhich( rSet, SID_ATTR_CHAR_OVERLINE, nWhich ) ) - { - const SvxOverlineItem& rItem = static_cast<const SvxOverlineItem&>( rSet.Get( nWhich ) ); - eOverline = rItem.GetValue(); - SetOverlineColor( rItem.GetColor() ); - } - else - eOverline = LINESTYLE_NONE; - - rFont.SetOverline( eOverline ); - rCJKFont.SetOverline( eOverline ); - rCTLFont.SetOverline( eOverline ); - - // Strikeout - FontStrikeout eStrikeout; - if( GetWhich( rSet, SID_ATTR_CHAR_STRIKEOUT, nWhich ) ) - { - const SvxCrossedOutItem& rItem = static_cast<const SvxCrossedOutItem&>( rSet.Get( nWhich ) ); - eStrikeout = rItem.GetValue(); - } - else - eStrikeout = STRIKEOUT_NONE; - - rFont.SetStrikeout( eStrikeout ); - rCJKFont.SetStrikeout( eStrikeout ); - rCTLFont.SetStrikeout( eStrikeout ); - - // WordLineMode - if( GetWhich( rSet, SID_ATTR_CHAR_WORDLINEMODE, nWhich ) ) - { - const SvxWordLineModeItem& rItem = static_cast<const SvxWordLineModeItem&>( rSet.Get( nWhich ) ); - rFont.SetWordLineMode( rItem.GetValue() ); - rCJKFont.SetWordLineMode( rItem.GetValue() ); - rCTLFont.SetWordLineMode( rItem.GetValue() ); - } - - // Emphasis - if( GetWhich( rSet, SID_ATTR_CHAR_EMPHASISMARK, nWhich ) ) - { - const SvxEmphasisMarkItem& rItem = static_cast<const SvxEmphasisMarkItem&>( rSet.Get( nWhich ) ); - FontEmphasisMark eMark = rItem.GetEmphasisMark(); - rFont.SetEmphasisMark( eMark ); - rCJKFont.SetEmphasisMark( eMark ); - rCTLFont.SetEmphasisMark( eMark ); - } - - // Relief - if( GetWhich( rSet, SID_ATTR_CHAR_RELIEF, nWhich ) ) - { - const SvxCharReliefItem& rItem = static_cast<const SvxCharReliefItem&>( rSet.Get( nWhich ) ); - FontRelief eFontRelief = rItem.GetValue(); - rFont.SetRelief( eFontRelief ); - rCJKFont.SetRelief( eFontRelief ); - rCTLFont.SetRelief( eFontRelief ); - } - - // Effects - if( GetWhich( rSet, SID_ATTR_CHAR_CASEMAP, nWhich ) ) - { - const SvxCaseMapItem& rItem = static_cast<const SvxCaseMapItem&>( rSet.Get( nWhich ) ); - SvxCaseMap eCaseMap = rItem.GetValue(); - rFont.SetCaseMap( eCaseMap ); - rCJKFont.SetCaseMap( eCaseMap ); - // #i78474# small caps do not exist in CTL fonts - rCTLFont.SetCaseMap( eCaseMap == SvxCaseMap::SmallCaps ? SvxCaseMap::NotMapped : eCaseMap ); - } - - // Outline - if( GetWhich( rSet, SID_ATTR_CHAR_CONTOUR, nWhich ) ) - { - const SvxContourItem& rItem = static_cast<const SvxContourItem&>( rSet.Get( nWhich ) ); - bool bOutline = rItem.GetValue(); - rFont.SetOutline( bOutline ); - rCJKFont.SetOutline( bOutline ); - rCTLFont.SetOutline( bOutline ); - } - - // Shadow - if( GetWhich( rSet, SID_ATTR_CHAR_SHADOWED, nWhich ) ) - { - const SvxShadowedItem& rItem = static_cast<const SvxShadowedItem&>( rSet.Get( nWhich ) ); - bool bShadow = rItem.GetValue(); - rFont.SetShadow( bShadow ); - rCJKFont.SetShadow( bShadow ); - rCTLFont.SetShadow( bShadow ); - } - - // Background - bool bTransparent; - if( GetWhich( rSet, bPreviewBackgroundToCharacter ? SID_ATTR_BRUSH : SID_ATTR_BRUSH_CHAR, nWhich ) ) - { - const SvxBrushItem& rBrush = static_cast<const SvxBrushItem&>( rSet.Get( nWhich ) ); - const Color& rColor = rBrush.GetColor(); - bTransparent = rColor.GetTransparency() > 0; - rFont.SetFillColor( rColor ); - rCJKFont.SetFillColor( rColor ); - rCTLFont.SetFillColor( rColor ); - } - else - bTransparent = TRUE; - - rFont.SetTransparent( bTransparent ); - rCJKFont.SetTransparent( bTransparent ); - rCTLFont.SetTransparent( bTransparent ); - - Color aBackCol( COL_TRANSPARENT ); - if( !bPreviewBackgroundToCharacter ) - { - if( GetWhich( rSet, SID_ATTR_BRUSH, nWhich ) ) - { - const SvxBrushItem& rBrush = static_cast<const SvxBrushItem&>( rSet.Get( nWhich ) ); - if( GPOS_NONE == rBrush.GetGraphicPos() ) - aBackCol = rBrush.GetColor(); - } - } - SetBackColor( aBackCol ); - - // Font - SetPrevFont( rSet, SID_ATTR_CHAR_FONT, rFont ); - SetPrevFont( rSet, SID_ATTR_CHAR_CJK_FONT, rCJKFont ); - SetPrevFont( rSet, SID_ATTR_CHAR_CTL_FONT, rCTLFont ); - - // Style - SetPrevFontStyle( rSet, SID_ATTR_CHAR_POSTURE, SID_ATTR_CHAR_WEIGHT, rFont ); - SetPrevFontStyle( rSet, SID_ATTR_CHAR_CJK_POSTURE, SID_ATTR_CHAR_CJK_WEIGHT, rCJKFont ); - SetPrevFontStyle( rSet, SID_ATTR_CHAR_CTL_POSTURE, SID_ATTR_CHAR_CTL_WEIGHT, rCTLFont ); - - // Size - SetFontSize( rSet, SID_ATTR_CHAR_FONTHEIGHT, rFont ); - SetFontSize( rSet, SID_ATTR_CHAR_CJK_FONTHEIGHT, rCJKFont ); - SetFontSize( rSet, SID_ATTR_CHAR_CTL_FONTHEIGHT, rCTLFont ); - - // Language - SetFontLang( rSet, SID_ATTR_CHAR_LANGUAGE, rFont ); - SetFontLang( rSet, SID_ATTR_CHAR_CJK_LANGUAGE, rCJKFont ); - SetFontLang( rSet, SID_ATTR_CHAR_CTL_LANGUAGE, rCTLFont ); - - // Color - if( GetWhich( rSet, SID_ATTR_CHAR_COLOR, nWhich ) ) - { - const SvxColorItem& rItem = static_cast<const SvxColorItem&>( rSet.Get( nWhich ) ); - Color aCol( rItem.GetValue() ); - rFont.SetColor( aCol ); - - rCJKFont.SetColor( aCol ); - rCTLFont.SetColor( aCol ); - - AutoCorrectFontColor(); // handle color COL_AUTO - } - - // Kerning - if( GetWhich( rSet, SID_ATTR_CHAR_KERNING, nWhich ) ) - { - const SvxKerningItem& rItem = static_cast<const SvxKerningItem&>( rSet.Get( nWhich ) ); - short nKern = static_cast<short>(LogicToLogic( rItem.GetValue(), rSet.GetPool()->GetMetric( nWhich ), MapUnit::MapTwip )); - rFont.SetFixKerning( nKern ); - rCJKFont.SetFixKerning( nKern ); - rCTLFont.SetFixKerning( nKern ); - } - - // Escapement - const sal_uInt8 nProp = 100; - short nEsc; - sal_uInt8 nEscProp; - if( GetWhich( rSet, SID_ATTR_CHAR_ESCAPEMENT, nWhich ) ) - { - const SvxEscapementItem& rItem = static_cast<const SvxEscapementItem&>( rSet.Get( nWhich ) ); - nEsc = rItem.GetEsc(); - nEscProp = rItem.GetProportionalHeight(); - - if( nEsc == DFLT_ESC_AUTO_SUPER ) - nEsc = DFLT_ESC_SUPER; - else if( nEsc == DFLT_ESC_AUTO_SUB ) - nEsc = DFLT_ESC_SUB; - } - else - { - nEsc = 0; - nEscProp = 100; - } - SetPrevFontEscapement( rFont, nProp, nEscProp, nEsc ); - SetPrevFontEscapement( rCJKFont, nProp, nEscProp, nEsc ); - SetPrevFontEscapement( rCTLFont, nProp, nEscProp, nEsc ); - - // Font width scale - if( GetWhich( rSet, SID_ATTR_CHAR_SCALEWIDTH, nWhich ) ) - { - const SvxCharScaleWidthItem&rItem = static_cast<const SvxCharScaleWidthItem&>( rSet.Get( nWhich ) ); - SetFontWidthScale( rItem.GetValue() ); - } - - Invalidate(); -} - void SvxFontPrevWindow::Init(const SfxItemSet& rSet) { SvxFont& rFont = GetFont(); diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index 9770f45587ff..1279f70a22f4 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -493,41 +493,6 @@ sal_Int32 SvxLanguageBoxBase::ImplTypeToPos( LanguageType eType ) const } -void SvxLanguageBoxBase::SetNoSelectionLBB() -{ - ImplSetNoSelection(); -} - -void SvxLanguageBoxBase::HideLBB() -{ - ImplHide(); -} - -void SvxLanguageBoxBase::DisableLBB() -{ - ImplDisable(); -} - -void SvxLanguageBoxBase::SaveValueLBB() -{ - ImplSaveValue(); -} - -sal_Int32 SvxLanguageBoxBase::GetSelectedEntryPosLBB() const -{ - return ImplGetSelectedEntryPos(); -} - -void* SvxLanguageBoxBase::GetEntryDataLBB( sal_Int32 nPos ) const -{ - return ImplGetEntryData( nPos); -} - -sal_Int32 SvxLanguageBoxBase::GetSavedValueLBB() const -{ - return ImplGetSavedValue(); -} - LanguageType LanguageBox::get_active_id() const { OUString sLang = m_xControl->get_active_id(); @@ -1129,43 +1094,6 @@ IMPL_LINK_NOARG( SvxLanguageComboBox, EditModifyHdl, Edit&, void ) } -sal_Int32 SvxLanguageComboBox::SaveEditedAsEntry() -{ - if (meEditedAndValid != EditedAndValid::Valid) - return COMBOBOX_ENTRY_NOTFOUND; - - LanguageTag aLanguageTag( vcl::I18nHelper::filterFormattingChars( GetText())); - LanguageType nLang = aLanguageTag.getLanguageType(); - if (nLang == LANGUAGE_DONTKNOW) - { - SAL_WARN( "svx.dialog", "SvxLanguageComboBox::SaveEditedAsEntry: unknown tag"); - return COMBOBOX_ENTRY_NOTFOUND; - } - - sal_Int32 nPos = ImplTypeToPos( nLang); - if (nPos != COMBOBOX_ENTRY_NOTFOUND) - return nPos; // Already present but with a different string. - - if (SvtLanguageTable::HasLanguageType( nLang)) - { - // In SvtLanguageTable but not in SvxLanguageComboBox. On purpose? This - // may be an entry with different settings or CTL instead of Western or - // ... all things we don't handle yet. - SAL_WARN( "svx.dialog", "SvxLanguageComboBox::SaveEditedAsEntry: already in SvtLanguageTable: " << - SvtLanguageTable::GetLanguageString( nLang) << ", " << nLang); - } - else - { - // Add to both, SvtLanguageTable and SvxLanguageComboBox. - /* TODO: a descriptive user comment would be a nice to have here. */ - SvtLanguageTable::AddLanguageTag( aLanguageTag ); - } - - nPos = InsertLanguage( nLang); - - return nPos; -} - sal_Int32 LanguageBox::SaveEditedAsEntry() { if (m_eEditedAndValid != EditedAndValid::Valid) diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 2491efe0228e..161ea49276e3 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -611,11 +611,6 @@ sal_Int64 NumericFormatter::GetValue() const return GetField() ? GetValueFromString(GetField()->GetText()) : 0; } -sal_Int64 NumericFormatter::GetSavedIntValue() const -{ - return GetField() ? GetValueFromString(GetField()->GetSavedValue()) : 0; -} - bool NumericFormatter::IsValueModified() const { if ( ImplGetEmptyFieldValue() ) |