diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2015-04-29 17:24:49 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2015-04-29 17:24:49 +0000 |
| commit | 556a53bca1b75b43730da749313f8a6827f2461d (patch) | |
| tree | 5168252b45657e213ce636a79c169e70133719c2 /src/widgets/text-toolbar.cpp | |
| parent | Fix a bug linking a path parameter to a transformed element (diff) | |
| download | inkscape-556a53bca1b75b43730da749313f8a6827f2461d.tar.gz inkscape-556a53bca1b75b43730da749313f8a6827f2461d.zip | |
Fix regression: Update default font-family if nothing is selected on canvas.
(bzr r14072)
Diffstat (limited to 'src/widgets/text-toolbar.cpp')
| -rw-r--r-- | src/widgets/text-toolbar.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp index 3d2e6eef8..ec011fffd 100644 --- a/src/widgets/text-toolbar.cpp +++ b/src/widgets/text-toolbar.cpp @@ -162,11 +162,17 @@ static void sp_text_fontfamily_value_changed( Ink_ComboBoxEntry_Action *act, GOb fontlister->fill_css( css ); SPDesktop *desktop = SP_ACTIVE_DESKTOP; - sp_desktop_set_style (desktop, css, true, true); // Results in selection change called twice. + if( desktop->getSelection()->isEmpty() ) { + // Update default + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + prefs->mergeStyle("/tools/text/style", css); + } else { + // If there is a selection, update + sp_desktop_set_style (desktop, css, true, true); // Results in selection change called twice. + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, + _("Text: Change font family")); + } sp_repr_css_attr_unref (css); - - DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, - _("Text: Change font family")); } // unfreeze |
