common/Log.hpp | 2 +- loleaflet/dist/toolbar/toolbar.js | 30 +++++++++++++++++++++++------- 2 files changed, 24 insertions(+), 8 deletions(-)
New commits: commit 40307955841b070483736117d41b9dff88013cfb Author: Pranav Kant <pran...@collabora.co.uk> Date: Sat Jan 21 17:24:16 2017 +0530 loleaflet: Make things simpler - use separate cell alignment commands ... instead of using HorizontalAlignment command with different parameters to do a cell alignment. The state change events for that would add further complexity here. Lets keep using separate UNO commands for alignment. Additonally, change a typo, 'alignblock' -> 'justifypara' when hiding the toolbar buttons on 'doclayerinit' event - we don't want to show justify alignment button for spreadsheets. Change-Id: Iaf7406af9e3172b3fa9d41b3dac6d1e2677f0db8 diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js index d3bde74..733dda9 100644 --- a/loleaflet/dist/toolbar/toolbar.js +++ b/loleaflet/dist/toolbar/toolbar.js @@ -489,10 +489,10 @@ $(function () { {type: 'html', id: 'backcolor-html', html: '<div id="backcolor-wrapper"><input id="backColorPicker" style="display:none;"></div>'}, {type: 'button', id: 'backcolor', img: 'backcolor', hint: _('Highlighting')}, {type: 'break'}, - {type: 'button', id: 'leftpara', img: 'alignleft', hint: _('Align left'), uno: 'LeftPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"1"}}'}, - {type: 'button', id: 'centerpara', img: 'alignhorizontal', hint: _('Center horizontally'), uno: 'CenterPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"2"}}'}, - {type: 'button', id: 'rightpara', img: 'alignright', hint: _('Align right'), uno: 'RightPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"3"}}'}, - {type: 'button', id: 'justifypara', img: 'alignblock', hint: _('Justified'), uno: 'JustifyPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"4"}}'}, + {type: 'button', id: 'leftpara', img: 'alignleft', hint: _('Align left'), uno: 'LeftPara', unosheet: 'AlignLeft'}, + {type: 'button', id: 'centerpara', img: 'alignhorizontal', hint: _('Center horizontally'), uno: 'CenterPara', unosheet: 'AlignHorizontalCenter'}, + {type: 'button', id: 'rightpara', img: 'alignright', hint: _('Align right'), uno: 'RightPara', unosheet: 'AlignRight'}, + {type: 'button', id: 'justifypara', img: 'alignblock', hint: _('Justified'), uno: 'JustifyPara', unosheet: ''}, {type: 'break', id: 'wraptextseparator'}, {type: 'button', id: 'wraptext', img: 'wraptext', hint: _('Wrap Text'), uno: 'WrapText'}, {type: 'button', id: 'togglemergecells', img: 'togglemergecells', hint: _('Merge and Center Cells'), uno: 'ToggleMergeCells'}, @@ -717,7 +717,23 @@ function toLocalePattern (pattern, regex, text, sub1, sub2) { function unoCmdToToolbarId(commandname) { - return commandname.toLowerCase().substr(5); + var id = commandname.toLowerCase().substr(5); + if (map.getDocType() === 'spreadsheet') { + switch (id) { + case 'alignleft': + id = 'leftpara'; + break; + case 'alignhorizontalcenter': + id = 'centerpara'; + break; + case 'alignright': + id = 'rightpara'; + break; + default: + id = null; + } + } + return id; } function selectItem(item, func) @@ -931,8 +947,8 @@ map.on('doclayerinit', function () { switch (docType) { case 'spreadsheet': - toolbarUp.remove('inserttable', 'styles', 'alignblock', 'defaultbullet', 'defaultnumbering', 'break-numbering'); - toolbarUpMore.remove('inserttable', 'styles', 'alignblock', 'defaultbullet', 'defaultnumbering', 'break-numbering'); + toolbarUp.remove('inserttable', 'styles', 'justifypara', 'defaultbullet', 'defaultnumbering', 'break-numbering'); + toolbarUpMore.remove('inserttable', 'styles', 'justifypara', 'defaultbullet', 'defaultnumbering', 'break-numbering'); statusbar.disable('zoomreset', 'zoomout', 'zoomin', 'zoomlevel'); statusbar.insert('left', [ {type: 'break', id:'break1'}, commit 8c5028de052b108992077752592bcf1198bb3b5f Author: Pranav Kant <pran...@collabora.co.uk> Date: Mon Jan 23 13:03:03 2017 +0530 fix build for poco 1.7.5 Change-Id: I9636a7dd63c714bdd375d19af3eec0677c6d47fc diff --git a/common/Log.hpp b/common/Log.hpp index d8788a2..1a47fc6 100644 --- a/common/Log.hpp +++ b/common/Log.hpp @@ -175,7 +175,7 @@ namespace Log } } -#define LOG_BODY_(PRIO, LVL, X) Poco::Message m_(l_.name(), "", Poco::Message::PRIO_##PRIO); char b_[1024]; std::ostringstream oss_(Log::prefix(b_, LVL, m_.getOsTid()), std::ostringstream::ate); oss_ << std::boolalpha << X << "| " << __FILE__ << ':' << __LINE__; m_.setText(oss_.str()); l_.log(m_); +#define LOG_BODY_(PRIO, LVL, X) Poco::Message m_(l_.name(), "", Poco::Message::PRIO_##PRIO); char b_[1024]; std::ostringstream oss_(Log::prefix(b_, LVL, m_.getTid()), std::ostringstream::ate); oss_ << std::boolalpha << X << "| " << __FILE__ << ':' << __LINE__; m_.setText(oss_.str()); l_.log(m_); #define LOG_TRC(X) do { auto& l_ = Log::logger(); if (l_.trace()) { LOG_BODY_(TRACE, "TRC", X); } } while (false) #define LOG_DBG(X) do { auto& l_ = Log::logger(); if (l_.debug()) { LOG_BODY_(DEBUG, "DBG", X); } } while (false) #define LOG_INF(X) do { auto& l_ = Log::logger(); if (l_.information()) { LOG_BODY_(INFORMATION, "INF", X); } } while (false) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits