[Libreoffice] [PATCH] [FDO#31252] Overwrite dialog improvement
Hello list, Here is a patch for fdo#31252[1] which improves the overwrite dialog as described in the bug. I don't know if the second part of the bug about backuping overwritten file is relevant, awaiting your advices on this. Sebastien [1] https://bugs.freedesktop.org/show_bug.cgi?id=31252 From 7587a74f285a12180a3e99d870003958f9b14c2b Mon Sep 17 00:00:00 2001 From: Sébastien Le Ray sebastien-libreoff...@orniz.org Date: Thu, 10 Feb 2011 18:54:59 +0100 Subject: [PATCH] Fixes bug fdo#31252 - Overwrite dialog improvment. --- fpicker/source/office/iodlg.cxx |7 ++- fpicker/source/office/iodlg.src |2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 7db9889..699081a 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -1247,7 +1247,12 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) { if ( ::utl::UCBContentHelper::Exists( aFileObj.GetMainURL( INetURLObject::NO_DECODE ) ) ) { -QueryBox aBox( pThis, WB_YES_NO, SvtResId( STR_SVT_ALREADYEXISTOVERWRITE ) ); +String aMsg = SvtResId( STR_SVT_ALREADYEXISTOVERWRITE ); +aMsg.SearchAndReplace( +String( RTL_CONSTASCII_USTRINGPARAM( $filename$ ) ), +aFileObj.getName(INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET) +); +QueryBox aBox( pThis, WB_YES_NO, aMsg ); if ( aBox.Execute() != RET_YES ) return 0; } diff --git a/fpicker/source/office/iodlg.src b/fpicker/source/office/iodlg.src index af24bd0..08ad36f 100644 --- a/fpicker/source/office/iodlg.src +++ b/fpicker/source/office/iodlg.src @@ -280,7 +280,7 @@ String STR_FILTERNAME_ALL String STR_SVT_ALREADYEXISTOVERWRITE { -Text [ en-US ] = The file already exists. Overwrite? ; +Text [ en-US ] = A file named \$filename$\ already exists.\n\nDo you want to replace it? ; }; String STR_SVT_NEW_FOLDER -- 1.7.2.3 signature.asc Description: PGP signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [PATCH] [FDO#31252] Overwrite dialog improvement
Le Fri, 11 Feb 2011 19:58:42 +0100, Jan Holesovsky ke...@suse.cz a écrit : Hi Sebastien, On 2011-02-11 at 09:31 +0100, Sébastien Le Ray wrote: Here is a patch for fdo#31252[1] which improves the overwrite dialog as described in the bug. Beautiful, thank you! :-) Pushed. I don't know if the second part of the bug about backuping overwritten file is relevant, awaiting your advices on this. Well - I am not a friend of backup to a randomly named file, you'll end up with disk full of backups that you never know what is which version of what ;-) Maybe you could add a button to launch the 'Save As...' dialog? - CCing the design team... Hi, Well, in fact, the message box is show as part of the save as workflow so just clicking No brings back to the save As dialog :) Sebastien signature.asc Description: PGP signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH] O(U)StringBuffer::toString()
Hi list, Since the toString() method is mentioned in the O*StringBuffer documentation I thought it was a good idea to actually have it... Patch is splitted in two parts. First adds the toString() methods and second perform some cleanup in OUStringBuffer unit tests (see commit message for details). Regards Sebastien From 2f494284de6acdbb4fdd63dfb7c36854b263c556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= sebastien-libreoff...@orniz.org Date: Sat, 12 Feb 2011 14:48:08 +0100 Subject: [PATCH 1/2] Added toString() method to O(U)StringBuffer. --- sal/inc/rtl/strbuf.hxx |5 + sal/inc/rtl/ustrbuf.hxx |6 ++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/sal/inc/rtl/strbuf.hxx b/sal/inc/rtl/strbuf.hxx index 9a78044..21ff603 100644 --- a/sal/inc/rtl/strbuf.hxx +++ b/sal/inc/rtl/strbuf.hxx @@ -275,6 +275,11 @@ public: */ const sal_Char* getStr() const { return pData-buffer; } +/** +Return a OString instance reflecting the current content +of this OStringBuffer. + */ +const OString toString() const { return OString(pData-buffer); } /** The character at the specified index of this string buffer is set diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx index 4977aac..b6160cc 100644 --- a/sal/inc/rtl/ustrbuf.hxx +++ b/sal/inc/rtl/ustrbuf.hxx @@ -274,6 +274,12 @@ public: */ const sal_Unicode* getStr() const { return pData-buffer; } +/** +Return a OUString instance reflecting the current content +of this OUStringBuffer. + */ +const OUString toString() const { return OUString(pData-buffer); } + /** The character at the specified index of this string buffer is set -- 1.7.2.3 From 1479dccd0ced9093937d50cae06c4abc10404cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= sebastien-libreoff...@orniz.org Date: Sat, 12 Feb 2011 14:48:56 +0100 Subject: [PATCH 2/2] Unit test cleanup for OUStringBuffer. Moved OUStringBuffer related tests from qa/srt/strings to qa/rt/oustringbuffer and reactivated it in project build. It seems that rtl_OUStringBuffer2.cxx was replaced by test_oustringbuffer_utf32.cxx so the later has been removed. Added unit tests for toString. --- sal/prj/build.lst |1 + sal/qa/rtl/oustringbuffer/makefile.mk | 49 +++- sal/qa/rtl/oustringbuffer/rtl_OUStringBuffer2.cxx | 103 --- .../test_oustringbuffer_noadditional.cxx | 36 + .../test_oustringbuffer_tostring.cxx | 64 + .../oustringbuffer/test_oustringbuffer_utf32.cxx | 136 sal/qa/rtl/strings/makefile.mk |1 - sal/qa/rtl/strings/test_oustringbuffer_utf32.cxx | 136 8 files changed, 254 insertions(+), 272 deletions(-) delete mode 100644 sal/qa/rtl/oustringbuffer/rtl_OUStringBuffer2.cxx create mode 100644 sal/qa/rtl/oustringbuffer/test_oustringbuffer_noadditional.cxx create mode 100644 sal/qa/rtl/oustringbuffer/test_oustringbuffer_tostring.cxx create mode 100644 sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx delete mode 100644 sal/qa/rtl/strings/test_oustringbuffer_utf32.cxx diff --git a/sal/prj/build.lst b/sal/prj/build.lst index 0d53b82..1b38581 100644 --- a/sal/prj/build.lst +++ b/sal/prj/build.lst @@ -22,3 +22,4 @@ sa sal\qa\osl\file nmake - u sa_qa_osl_file sa_cppunittester sa_util NULL sa sal\qa\osl\module nmake - u sa_qa_osl_module sa_cppunittester sa_util NULL sa sal\qa\osl\condition nmake - all sa_qa_osl_condition sa_cppunittester sa_util NULL sa sal\qa\rtl\strings nmake - all sa_qa_rt_strings sa_cppunittester sa_util NULL +sa sal\qa\rtl\oustringbuffer nmake - all sa_qa_rt_oustringbuffer sa_cppunittester sa_util NULL diff --git a/sal/qa/rtl/oustringbuffer/makefile.mk b/sal/qa/rtl/oustringbuffer/makefile.mk index 544f7b7..9165daa 100644 --- a/sal/qa/rtl/oustringbuffer/makefile.mk +++ b/sal/qa/rtl/oustringbuffer/makefile.mk @@ -25,46 +25,31 @@ # #* -PRJ=..$/..$/.. -INCPRE+= $(PRJ)$/qa$/inc +PRJ := ..$/..$/.. +PRJNAME := sal -PRJNAME=sal -TARGET=rtl_oustringbuffer2 +TARGET := qa_rtl_oustringbuffer -ENABLE_EXCEPTIONS=TRUE +ENABLE_EXCEPTIONS := TRUE -# --- Settings - +.INCLUDE: settings.mk -.INCLUDE : settings.mk CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) CFLAGSCXX += $(CPPUNIT_CFLAGS) -# BEGIN -# auto generated Target:joblist by codegen.pl -SHL1OBJS= \ -$(SLO)$/rtl_OUStringBuffer2.obj - -SHL1TARGET= rtl_OUStringBuffer2 -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) - -SHL1IMPLIB= i$(SHL1TARGET) -# SHL1DEF=$(MISC)$/$(SHL1TARGET).def - -DEF1NAME=$(SHL1TARGET) -# DEF1EXPORTFILE= export.exp -SHL1VERSIONMAP=
Re: [Libreoffice] [PUSHED] Re: [PATCH] O(U)StringBuffer::toString()
Le Mon, 14 Feb 2011 21:21:52 +, Caolán McNamara caol...@redhat.com a écrit : As an aside, if you're big into the sal unit tests there's probably quite a few of them potentially useful which haven't been tweaked to work again, or are behind SUBSEQUENT_TESTS but probably don't need to be inside that conditional, i.e. they would work in a build-from-scratch state. Hi, Actually I'm gonna start adding missing methods from UniString/ByteString to O(U)String and StringBuffer so I guess I'll activate tests while I add methods... Regards Sebastien signature.asc Description: PGP signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [EasyHacks] Protocol capitalization
Hi list, Here are two patch regarding the Easy Hack Improve Autocorrect capitalize first word in sentence (on the wiki). First one improves french autocorrection for non breaking space before : when you enter a protocol. I didn't remove the code handling the :// case since INETUrlObject does not contains ftps://, imaps:// and other protocols. I could modify INETUrlObject if needed to handle these and get ride of this special case. Second one prevents capitalisation of recognized protocole (e.g. http: will never be replaced by Http: even at the beginning of a sentence). Awaiting your comments Sebastien From f3b0ae7733ee0229b960c779ab7a381a6ea28755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= sebastien-libreoff...@orniz.org Date: Mon, 21 Feb 2011 00:38:25 +0100 Subject: [PATCH 1/2] Better protocols handling in french autocorrect --- editeng/source/misc/svxacorr.cxx | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index ed14c46..0c08373 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -654,8 +654,14 @@ BOOL SvxAutoCorrect::FnAddNonBrkSpace( { // Get the last word delimiter position xub_StrLen nSttWdPos = nEndPos; -while( nSttWdPos !IsWordDelim( rTxt.GetChar( --nSttWdPos ))) +bool bWasWordDelim = false; +while( nSttWdPos !(bWasWordDelim = IsWordDelim( rTxt.GetChar( --nSttWdPos ; + +if(INetURLObject::CompareProtocolScheme(rTxt.Copy(nSttWdPos + (bWasWordDelim ? 1 : 0), nEndPos - nSttWdPos + 1)) != INET_PROT_NOT_VALID) { +return FALSE; +} + // Check the presence of :// in the word xub_StrLen nStrPos = rTxt.Search( String::CreateFromAscii( :// ), nSttWdPos + 1 ); @@ -791,11 +797,11 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc rDoc, xub_StrLen nSttPos, xub_StrLen nEndPos, LanguageType eLang ) { -// Two capital letters at the beginning of a paragraph? + if( !rTxt.Len() || nEndPos = nSttPos ) return FALSE; - CharClass rCC = GetCharClass( eLang ); +CharClass rCC = GetCharClass( eLang ); String aText( rTxt ); const sal_Unicode *pStart = aText.GetBuffer(), *pStr = pStart + nEndPos, -- 1.7.2.3 From 8f7798219b3c6e9510cf6672f7eeacd2d4feea2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= sebastien-libreoff...@orniz.org Date: Mon, 21 Feb 2011 08:44:51 +0100 Subject: [PATCH 2/2] Disable protocols capitalization --- editeng/source/misc/svxacorr.cxx |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 0c08373..70c9728 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -836,7 +836,6 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc rDoc, } } while( 0 == ( bAtStart = (pStart == pStr)) ); - if( !pWordStt || rCC.isDigit( aText, sal::static_int_cast xub_StrLen ( pStr - pStart ) ) || @@ -844,6 +843,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc rDoc, rCC.getCharacterType( aText, sal::static_int_cast xub_StrLen ( pWordStt - pStart ) ) ) || +INetURLObject::CompareProtocolScheme(rTxt.Copy(pWordStt - pStart, pDelim - pWordStt + 1)) != INET_PROT_NOT_VALID || 0x1 == *pWordStt || 0x2 == *pWordStt ) return FALSE; // no character to be replaced, or already ok -- 1.7.2.3 signature.asc Description: PGP signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH] Remove include of no more existent errhdl.hxx
Hi list, This patch removes an include which prevent debug build of sw (the file has been deleted in commit 6aa93c291d18c7db6dbee73adc6c4aa1bdc88eda. Regards Sébastien diff --git a/sw/source/core/except/dbgloop.cxx b/sw/source/core/except/dbgloop.cxx index ddb3a7b..370be63 100644 --- a/sw/source/core/except/dbgloop.cxx +++ b/sw/source/core/except/dbgloop.cxx @@ -34,7 +34,6 @@ #endif #include tools/stream.hxx #include dbgloop.hxx -#include errhdl.hxx DbgLoopStack DbgLoop::aDbgLoopStack; signature.asc Description: PGP signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH][WIP] fdo#31251 - Improve default page layout
Hi list, Attached is a patch that improves Writer page as described in fdo#31251[1]. After a quick poll on various LibreOffice user it appears that a halo on the four borders is confusing so we have a smooth shadow on two borders. There are still some little glitches and book mode is not fully handled but I'd rather post the patch before Murphy's Law crashes my disk or burn my house and to get comments before going . If you want to do an incremental build, you'll have to build and deliver sw and then run packimages (cd packimages build), if all is fine images should end up in images.zip. Sébastien [1] https://bugs.freedesktop.org/show_bug.cgi?id=31251 From 56bceaec5cef9593f23219b6d257e8073ec34426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= sebastien-libreoff...@orniz.org Date: Sun, 27 Feb 2011 18:06:13 +0100 Subject: [PATCH] Added shadow images. --- default_images/sw/res/page-bottom-shadow.png | Bin 0 - 193 bytes default_images/sw/res/page-bottomleft-shadow.png | Bin 0 - 285 bytes default_images/sw/res/page-bottomright-shadow.png | Bin 0 - 289 bytes default_images/sw/res/page-right-shadow.png | Bin 0 - 191 bytes default_images/sw/res/page-topright-shadow.png| Bin 0 - 306 bytes 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 default_images/sw/res/page-bottom-shadow.png create mode 100644 default_images/sw/res/page-bottomleft-shadow.png create mode 100644 default_images/sw/res/page-bottomright-shadow.png create mode 100644 default_images/sw/res/page-right-shadow.png create mode 100644 default_images/sw/res/page-topright-shadow.png diff --git a/default_images/sw/res/page-bottom-shadow.png b/default_images/sw/res/page-bottom-shadow.png new file mode 100644 index ..fe881a97cc14556d3da978024cbff78912d9c1f6 GIT binary patch literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^j6lrA!3HEtFPV6O1d4;)ofy`glX(f`uqAoByDC* z!3BGlPXx`7I;J!Gca%qgD@k*tT_@uLG}_)Usv|qOwv5Ef(_TEPz6iC9V-AiT2y zsd*~PAz-C8;S2(VZJ3hti10pX2;y^_*o-U3d9M_X~)cpNZug1pK_S}buhv)o* dBgJ!)7y`CFFSDR?joQ%22WQ%mvv4FO#nZmHPrwB literal 0 HcmV?d1 diff --git a/default_images/sw/res/page-bottomleft-shadow.png b/default_images/sw/res/page-bottomleft-shadow.png new file mode 100644 index ..9e4a72b1acacb82f99f323cdaf415f39f6cf4774 GIT binary patch literal 285 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V86ZZI=f4F%}28J29*~C-V}VN3FMcVYMs zf(!O8p9~b?EbxddW?kJ24O~qS#uSg6t)pzOL-InWTB7S!Zr$J`5C^*?YcB5}F z{OPy4m=JQjSWm3V6A%C;tCGUuV+^^^)+FS^@J~U1bCtvtFK(`hDu#l3gpk)-)Ma zRPYxZjMtxEEwkZZ`Z2-f8tCp*BD+qR^E3^??sE|Jf~ZVolCpkMehMFTOIbsNG_ zK2+_h)2xad)Uuw7d@Q-3^*a-3)VjFP0X?)4}B-uE+f@_MIqu7b0x{^*3_{9LzP ZOgjP$+h*;pA+a%22WQ%mvv4FO#mOpXPsR literal 0 HcmV?d1 diff --git a/default_images/sw/res/page-bottomright-shadow.png b/default_images/sw/res/page-bottomright-shadow.png new file mode 100644 index ..ff00470bc5f24ee6ede99cbc892430cb9cbea8c9 GIT binary patch literal 289 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V86ZZI=f4F%}28J29*~C-V}VN3FMcVYMs zf(!O8p9~b?EbxddW?kJ24O~qS#uSg6t)pzOL-InWTB7v}5Y*eSty?JzX3_BreBZ zu+BSdAkgyAzfpgQ|r64iU{7=H=cgo*Q-C`$go~+QcL#DEz-Gx#^e1{`WtQJWbsz zbN=3@p9h(_!*VXhm3Uoe4)2*^;J*K2;iqcb~`@dyrnNiUYm*^_6xU_Zfj6p7G7{H z!dAJY^HOrot8e$KxGhpIiQa!PYuDR_4b^fb{`5L_b=)CIJ+_3Hs@vIlMN8zg7F dDl1%J-z5}XI;H;3ZPdJYD@);T3K0RYisYEb|H literal 0 HcmV?d1 diff --git a/default_images/sw/res/page-right-shadow.png b/default_images/sw/res/page-right-shadow.png new file mode 100644 index ..7b8870ed042f72bb7da4e0c6abcc1930b778cb0f GIT binary patch literal 191 zcmeAS@N?(olHy`uVBq!ia0vp^AT}ch82ed)xHkIDGqXXVpw-h|UBBmgMd3!tfsi z7wla=87RV8;1OBOz`!jG!i)^F=12eq*-JcqUDClN%P2%ck|0SZZ$xJHyX=jZ08 z=9Mrw7o{eaq^2m8XO?6rxO@5rgg5eu0~JYmx;Tb#TuIp^Y3Z8(Z6R9v+_a3w~Id a*)i}JaZe36ll2Cuiowt;ucLK6Tx@?;% literal 0 HcmV?d1 diff --git a/default_images/sw/res/page-topright-shadow.png b/default_images/sw/res/page-topright-shadow.png new file mode 100644 index ..2603731527826eb1143d6191c4e27950b0d67d81 GIT binary patch literal 306 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V86ZZI=f4F%}28J29*~C-V}VN3FMcVYMs zf(!O8p9~b?EbxddW?kJ24O~qS#uSg6t)pzOL-InWTB7g%!lO#%vS@^owk+Xt z-Zt-0fPm}6^LO++yfUWC~aou;`+9qLtJl9rv|G4M_+TWfwJPflG*0y3luV0Zc ze9-c^YOCa(Jwm5FWFxo4elFtnOR{(*Tf-@yUe$B{nxBwzk%bw~L`-z|D$9DY6g z=K-1b6^FC4QXa=|$#qvdx-`?FKl!$4I}7`pKv9v0)m+crZJrp~raipEzM*@+g%MT vWH0zLT=o#H`d)eF^3|m?FS#yu`N)6J*I4l5y#Ka9*E4v!`njxgN@xNA0Viz literal 0 HcmV?d1 -- 1.7.2.3 From bbcce6e250f5bafa61aac8ed099d47bc99a4f6cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= sebastien-libreoff...@orniz.org Date: Sun, 27 Feb 2011 17:23:48 +0100 Subject: [PATCH 1/2] FDO#31251 - Add resources files for page shadow --- sw/inc/rcid.hrc |5 sw/source/core/inc/pagefrm.hrc| 49 + sw/source/core/layout/makefile.mk |
Re: [Libreoffice] OString += OString + char ... ?
Le Mon, 28 Feb 2011 21:45:36 +, Caolán McNamara caol...@redhat.com a écrit : On Sun, 2011-02-27 at 04:27 -0500, Kevin Hunter wrote: Three possibilities I guess, 1) remove the explicit, but I'm sure its there due to some other horribly implicit conversion horror 2) add a operator+(sal_Char), either one that just works, or one that raises an error at compile time. 3) remove the const sal_Char* conversion operator (I'm tempted towards this one) If someone takes this, he/She should add a operator[](int) to allow byChar access (or a getChar method)... Sébastien signature.asc Description: PGP signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH] fdo#31251 - Improve default page layout
Hi list, Here is a complete patch for fdo#31251. It adds a smooth shadow to the page. During its development, I found that SwRect::_Intersection (used in page margin painting) returns negative height/width if the two rectangles do not overlap. I don't know if it is the expected behavior or a bug. If it's a bug I guess I can provide a patch. Regards Sebastien From 4023f62b41d3a625a014ee1539506153057ad668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= sebastien-libreoff...@orniz.org Date: Tue, 1 Mar 2011 22:29:50 +0100 Subject: [PATCH 7/7] Correct some minor graphical glitches. SwRect::_Intersection() returns rectangles with negative height/width when there is no intersection which cause artifacts when drawing them... This bug has been present for a long time but wasn't so evident since margins were only 2 opaque black pixels. --- sw/source/core/layout/paintfrm.cxx |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index ff8395d..ec6a5d6 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -5192,6 +5192,8 @@ void SwPageFrm::PaintMarginArea( const SwRect _rOutputRect, { SwRect aPgRect = Frm(); aPgRect._Intersection( _rOutputRect ); +if(aPgRect.Height() 0 || aPgRect.Width() = 0)// No intersection +return; SwRegionRects aPgRegion( aPgRect ); aPgRegion -= aPgPrtRect; const SwPageFrm* pPage = static_castconst SwPageFrm*(this); -- 1.7.2.3 From aedfc3ec43536f1e137e4e04c63bab8443c11c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= sebastien-libreoff...@orniz.org Date: Mon, 28 Feb 2011 23:04:30 +0100 Subject: [PATCH 6/7] Properly handle shadow when in book mode. --- sw/source/core/inc/pagefrm.hxx| 13 + sw/source/core/layout/paintfrm.cxx| 42 sw/source/core/view/pagepreviewlayout.cxx |4 +- 3 files changed, 45 insertions(+), 14 deletions(-) diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx index 3c0c1cb..f1aa731 100644 --- a/sw/source/core/inc/pagefrm.hxx +++ b/sw/source/core/inc/pagefrm.hxx @@ -138,6 +138,7 @@ class SwPageFrm: public SwFtnBossFrm static void GetBottomShadowRect( const SwRect _rPageRect, ViewShell*_pViewShell, SwRect _orBottomShadowRect, + bool bFullBottomShadow, bool bRightSidebar ); /** adds the sidebar used for notes to right and left border @@ -314,10 +315,22 @@ public: @param _pViewShell input parameter - instance of the view shell, on which the output has to be generated. + +@param bPaintRightShadow +Should we paint shadow on the right or not (used in book mode) + +@param bFullBottomShadow +Should we have a bottom shadow of the same size as the pages or +not (for right pages in book mode in a LTR environment). + +@param bRightSidebar +Is the note sidebar on the right or not (used to adjust the +shadow with position). */ static void PaintBorderAndShadow( const SwRect _rPageRect, ViewShell*_pViewShell, bool bPaintRightShadow, + bool bFullBottomShadow, bool bRightSidebar ); /** get bound rectangle of border and shadow for repaints diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index d461d86..ff8395d 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -2857,7 +2857,16 @@ void SwRootFrm::Paint( const SwRect rRect, const SwPrtOptions *pPrintData ) con while ( pPage ) // -- { +// Paint right shadow in single page mode, or if we're on last page of +// the doc, or if ???Lower()??? or if we're on a page with no right +// sibling (OnRightPage should be renamed as OnEvenPage since it does +// not take reading direction into account) const bool bPaintRightShadow = !bBookMode || (!pPage-GetNext()) || (pPage == Lower()) || (!bLTR !pPage-OnRightPage()) || (bLTR pPage-OnRightPage()); +// Have a full bottom shadow on side by side pages. +// TODO Do not draw full shadow if our sibling hasn't the +// same orientation +const bool bFullBottomShadow = bBookMode pPage-GetPrev() +((!bLTR !pPage-OnRightPage()) || (bLTR pPage-OnRightPage())); const bool bRightSidebar = pPage-SidebarPosition() == sw::sidebarwindows::SIDEBAR_RIGHT; if ( !pPage-IsEmptyPage() ) @@ -2963,7 +2972,7 @@ void SwRootFrm::Paint( const
Re: [Libreoffice] [PUSHED] fdo#31251 - Improve default page layout
Le Thu, 03 Mar 2011 21:35:11 +0100, Christoph Noack christ...@dogmatux.com a écrit : Hi Sébastien, hi all! Hi Am Donnerstag, den 03.03.2011, 14:16 +0100 schrieb Sébastien Le Ray: Le Thu, 03 Mar 2011 11:59:19 +, Michael Meeks michael.me...@novell.com a écrit : [...] Although I didn't see it yet, thanks for your work - I'm really looking forward. You can find a screenshot on http://misc.orniz.org/libreoffice/lo-shadow.png book mode is also handled nicely... [...] However, I'd like to provide some pointers to the Notes stuff - it's really worth spending some time digging through some of the descriptions (in my point-of-view). I think this is better than pre-process most of the stuff, since I'm unaware of your likings :-) The notes main wiki page (Notes2 because of the CWS that time): http://wiki.services.openoffice.org/wiki/Notes2 Here are the links to the detailed designs that had (sometimes) to be adapted due to technical constraints nobody spent the time for: http://wiki.services.openoffice.org/wiki/Notes2#Status_and_Proposals And once finished with the default stuff, we have lots of further ideas: http://wiki.services.openoffice.org/wiki/Notes2_OtherIdeas Personally, I've already spend over one year with the Notes project being the UX representative, so I'd like to work with you on that - if you like :-) I'll be pleased to :) It'd be nice to have a UI tasks on libreoffice wiki presenting all tasks that are ready on a Design point of view but that have not yet been implemented. There is a lot of stuff on the Note2 wiki page, could you give priorities on various items? [...] If you are generally interested in working on Usability / Visual Design topics (of course, from the developer's point-of-view - and we really need some understanding and support here), feel invited to subscribe to the Design Team mailing list - some more information can be found here: http://wiki.documentfoundation.org/Design Subscribed yesterday :-) It seems that you've been busy with more marketting stuff that UI design lately to cover the launch of LO, FOSDEM and funraising Waiting for you priorities mockups on notes work :-) Sébastien ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [PUSHED] fdo#31251 - Improve default page layout
Le Thu, 03 Mar 2011 11:59:19 +, Michael Meeks michael.me...@novell.com a écrit : Hi Sebastien, On Tue, 2011-03-01 at 23:42 +0100, Sébastien Le Ray wrote: Here is a complete patch for fdo#31251. It adds a smooth shadow to the page. Wow - it is really pretty indeed :-) I just pushed it. Nice work ! can you confirm is it LGPLv3+/MPL ? Incidentally, it would be lovely to have the post-it notes, not only to have a border, but to have curved corners at the bottom, but not the top, so they really look like sticky notes. ie. take a sticky note an stick it flat on your desk, and you see the effect [ both bottom corners curl slightly ] ;-) possibly that will require some (manual?) re-coloring action of the bitmaps, which might be slightly painful, though I guess it is just a matter of keeping a constant AlphaMask bitmap around, and merging it into a BitmapEx with a Bitmap (of the same size obviously) 'Erase'd with the correct color for the note. During its development, I found that SwRect::_Intersection (used in page margin painting) returns negative height/width if the two rectangles do not overlap. I don't know if it is the expected behavior or a bug. If it's a bug I guess I can provide a patch. Ho hum - probably a difficult one to audit for, to check every location to ensure they are not depending on this. Possibly it makes the impl. faster too (?). Well worth documenting though in the API. Thanks ! Michael. Hi, this simple shadow patch has generated a long discussion on Libreoffice-design. Some people don't like the color, some people don't like the amount of blur, some people want no shadow at all, some people want a 4 borders shadow. So here is a second patchset that tries to address the first three critics : - It adds a configuration option (in Appearance category) to set shadow color. It currently defaults to gray but I'm sure design team will find a more sensitive default : - It adds a configuration option to disable shadow; - It doesn't use bitmaps directly anymore but an alpha mask, so if people want to try another blur effect, they just have to edit images.zip:/sw/res/page-*-shadow-mask.png These are black white image. Black amount determines transparency, white being fully transparent. Here again, I'm sure that design people will find a better default. Only constraints are 1x10px for bottom shadow, 10x10px for corner and 10x1px for right shadow. I'll let design team play and discuss with that, when they agree on a default, I'll provide an additional patch to take it into account. Note: I had to perform a make dev-install for settings to be correctly saved. Regards Sébastien From 56705efe8542ad48d7e2b498d702c067878aab26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= sebastien-libreoff...@orniz.org Date: Tue, 8 Mar 2011 08:02:08 +0100 Subject: [PATCH] Added shadow color configuration save. --- svtools/inc/svtools/colorcfg.hxx |1 + svtools/source/config/colorcfg.cxx |2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/svtools/inc/svtools/colorcfg.hxx b/svtools/inc/svtools/colorcfg.hxx index 6231685..5c95dc1 100644 --- a/svtools/inc/svtools/colorcfg.hxx +++ b/svtools/inc/svtools/colorcfg.hxx @@ -51,6 +51,7 @@ enum ColorConfigEntry ANCHOR , SPELL , SMARTTAGS , +SHADOWCOLOR , WRITERTEXTGRID , WRITERFIELDSHADINGS , WRITERIDXSHADINGS , diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx index c98c885..7be72cf 100644 --- a/svtools/source/config/colorcfg.cxx +++ b/svtools/source/config/colorcfg.cxx @@ -137,6 +137,7 @@ uno::Sequence OUString ColorConfig_Impl::GetPropertyNames(const rtl::OUString { RTL_CONSTASCII_USTRINGPARAM(/Anchor) ,sal_False }, { RTL_CONSTASCII_USTRINGPARAM(/Spell) ,sal_False }, { RTL_CONSTASCII_USTRINGPARAM(/SmartTags) ,sal_False }, +{ RTL_CONSTASCII_USTRINGPARAM(/Shadow), sal_True }, { RTL_CONSTASCII_USTRINGPARAM(/WriterTextGrid) ,sal_False }, { RTL_CONSTASCII_USTRINGPARAM(/WriterFieldShadings),sal_True }, { RTL_CONSTASCII_USTRINGPARAM(/WriterIdxShadings) ,sal_True }, @@ -428,6 +429,7 @@ Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry) 0, // ANCHOR 0xff, // SPELL COL_LIGHTMAGENTA,// SMARTTAGS +COL_GRAY, // SHADOWCOLOR 0xc0c0c0, // WRITERTEXTGRID 0xc0c0c0, // WRITERFIELDSHADIN 0xc0c0c0, // WRITERIDXSHADINGS -- 1.7.4.1 From c30a7d8001c04bacead8b72c175e640e76ee4017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= sebastien-libreoff...@orniz.org Date: Tue, 8 Mar 2011 08:02:57 +0100 Subject: [PATCH] Added shadow configuration to prefs schema. --- .../registry/data/org/openoffice/Office/UI.xcu |8
Re: [Libreoffice] [PATCH] fdo#31251 - Improve default page layout
Le Sat, 16 Apr 2011 13:31:58 +, Thomas Arnhold tho...@arnhold.org a écrit : Hi, I like your patches for the new smooth shadow. I looked around the other LibO apps like Impress or Draw. They have this shadow already, but it's not as width as in Writer and it's on all sides. Maybe we should do it in Writer as in Draw and Impress. Looks better I think. Here is what I mean: http://infoo.org/shot-20110323-062300.png Thomas Hi, I was planning to go on on draw impress this week but it seems someone already did the job… I don't know where this shadow comes from, maybe from the OOo integration… I can't see any git log message related to it Sebastien signature.asc Description: PGP signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [PATCH] fdo#31251 - Improve default page layout
Le Sat, 16 Apr 2011 14:58:46 +0200, Christoph Noack christ...@dogmatux.com a écrit : Hi Sébastien, Thomas, all! Am Samstag, den 16.04.2011, 14:41 +0200 schrieb Sébastien Le Ray: Le Sat, 16 Apr 2011 13:31:58 +, Thomas Arnhold tho...@arnhold.org a écrit : I like your patches for the new smooth shadow. I looked around the other LibO apps like Impress or Draw. They have this shadow already, but it's not as width as in Writer and it's on all sides. Maybe we should do it in Writer as in Draw and Impress. Looks better I think. Here is what I mean: http://infoo.org/shot-20110323-062300.png I was planning to go on on draw impress this week but it seems someone already did the job… I don't know where this shadow comes from, maybe from the OOo integration… I can't see any git log message related to it Yes, this is very likely ... that was something being planned since several months (based on UX team discussions), but I didn't knew that the Impress team finally implemented that. @ Thomas: Do you have some screenshots how it looks like? I plan to have a look at a recent daily build, so I hope to have a look at it. @ Sébastien: Would it be possible that you'll have a look how it is implemented. Any chance that we - as Thomas mentioned - get this streamlined throughout the applications? Yes I'm gonna check this out… But If nothing more has changed, the way page redraw is handled in writer is much more different than the way it is in draw… What we do not know is if OOo did the work for writer too and we've overriden it or if it hasn't been done… signature.asc Description: PGP signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [PATCH] fdo#31251 - Improve default page layout
Le Sat, 16 Apr 2011 15:08:23 +0200, Christoph Noack christ...@dogmatux.com a écrit : Hi Sébastien! Thanks for the ultra-fast reply :-) Am Samstag, den 16.04.2011, 15:01 +0200 schrieb Sébastien Le Ray: Le Sat, 16 Apr 2011 14:58:46 +0200, [...] @ Sébastien: Would it be possible that you'll have a look how it is implemented. Any chance that we - as Thomas mentioned - get this streamlined throughout the applications? Yes I'm gonna check this out… But If nothing more has changed, the way page redraw is handled in writer is much more different than the way it is in draw… What we do not know is if OOo did the work for writer too and we've overriden it or if it hasn't been done… I don't think so ... last time we discussed that at OOo, the shadow improvements were related to Renaissance. And the Renaissance project explicitly addressed Impress (and Draw, since it is based on the very same code base). So we may have some further benefit with Writer :-) I looked at sd code, they've done mostly what I planned to do. As I previously said, impress/draw and writer code differs on a design point of view so I cannot reuse it as is. We've a 4 sided shadow, should I port it Writer as is or are their request of improvment? Should I let the color configuration option for shadow color and use the value under draw or just drop it? Regards Sébastien signature.asc Description: PGP signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [PATCH] fdo#31251 - Improve default page layout
Le Mon, 18 Apr 2011 23:53:56 +0200, Christoph Noack christ...@dogmatux.com a écrit : Hi Sébastien, all! Am Montag, den 18.04.2011, 22:47 +0200 schrieb Sébastien Le Ray: Le Sat, 16 Apr 2011 15:08:23 +0200, Christoph Noack christ...@dogmatux.com a écrit : [...] Am Samstag, den 16.04.2011, 15:01 +0200 schrieb Sébastien Le Ray: Le Sat, 16 Apr 2011 14:58:46 +0200, [...] @ Sébastien: Would it be possible that you'll have a look how it is implemented. Any chance that we - as Thomas mentioned - get this streamlined throughout the applications? Yes I'm gonna check this out… [...] I don't think so ... last time we discussed that at OOo, the shadow improvements were related to Renaissance. And the Renaissance project explicitly addressed Impress (and Draw, since it is based on the very same code base). So we may have some further benefit with Writer :-) I looked at sd code, they've done mostly what I planned to do. As I previously said, impress/draw and writer code differs on a design point of view so I cannot reuse it as is. Okay, so the only chance it to let it look similar. We've a 4 sided shadow, should I port it Writer as is or are their request of improvment? Should I let the color configuration option for shadow color and use the value under draw or just drop it? Not an easy answer, so a step-by-step approach ... easy to tough questions: * Their shadow looks very good (what I could see in my VM) -- It would already be an improvement to copy it to Writer (just out of curiousity: how did they implement them - masks, bitmaps with alpha channel, ...) They used a simple bimap. Their approach is more or less the same as the first implementation I did (when no color configuration was possible), except they just use one bitmap that they split at predefined positions instead of having one bitmap per side/corner. * The shadow color configuration might be dropped -- At least if we can find a shadow that works well on most backgrounds (e.g. finding an appropriate color, or calculating the shadow based on the application background color - preferred). That would save users a bit effort and help the translation / documentation teams as well. I guess the current impress shadow should be nice on any background since there is an alpha channel and no area has a full opacity… * Anyway, it would be good to have a bit more control how the shadow was created, because we might need matching shadows for other objects (e.g. Notes, Panes, ...) -- I think, the specification we've started is a good basis, so do you think we can continue with that (see my note below, please). I just need to know what graphics we can use to realize good effects at the document edges (see my last mail). I can't find the mail about the document corners… I attached you the bitmap used in impress to draw the shadow. * A more attractive document background is still desirable -- can we go with a gradient in the next step? I think we'll have to test how gradients can be used to get a nice background. Keeping in mind that current gradient implementation focuses on performances rather than on quality… Note: During the weekend, I've started to redo some of the graphics for the specification page - but I haven't uploaded them yet. At the moment, some further (independent) thoughts led to a shadow that's very close to the Impress one. Sorry for the many questions / comments - but I'd like to understand more what's needed and how a solution might look like that's comfortable (so to say) to implement. As always - thanks in advance :-) I'll try to quickly implement and push impress shadow to sw so you can see the result throught the nightlies Cheers, Christoph Regards, Sébastien attachment: pageshadow35x35.png signature.asc Description: PGP signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [PATCH] fdo#31251 Writer Impress shadow consistency
Le Tue, 3 May 2011 14:23:44 +0200, David Tardon dtar...@redhat.com a écrit : On Sat, Apr 30, 2011 at 06:58:29PM +0200, Sébastien Le Ray wrote: if(aShadowColor != SwViewOption::GetShadowColor() ) { aShadowColor = SwViewOption::GetShadowColor(); -AlphaMask aMask( SW_RES( BMP_PAGE_BOTTOM_RIGHT_SHADOW_MASK ) ); -Bitmap aFilledSquare( Size( mnShadowPxWidth, mnShadowPxWidth ), 24 ); -aFilledSquare.Erase( aShadowColor ); +AlphaMask aMask( shadowMask.getBottomRight().GetBitmap() ); +Bitmap aFilledSquare( aMask.GetSizePixel(), 24 ); +aFilledSquare.Erase( aShadowColor ); ... This looks like a good candidate for a function... Like void lcl_createShadow(Color const rColor, BitmapEx const rMask, BitmapEx rShadow) { AlphaMask aMask( rMask.GetBitmap() ); Bitmap aFilledSquare( aMask.GetSizePixel(), 24 ); aFilledSquare.Erase( rColor ); rShadow = aFilledSquare; } But this is really just nice to have, not a blocker :) OK, I'll try to find some time to write it [...] Do I count wrong or is the right shadow painted over the bottom right corner shadow? And the same for left shadow lower. Well, it shouldn't since we do not have visual overlap. Corners are 17px large, 8 of them come to the adjacent borders so we scale borders to remove those 8px… @@ -5326,20 +5326,19 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 9; aPageTopRightShadow ); BitmapEx aPageRightShadow = aPageRightShadowBase; aPageRightShadow.Scale( 1, aPagePxRect.Height() - 2 * (mnShadowPxWidth - 1) ); - pOut-DrawBitmapEx( pOut-PixelToLogic( Point( aPagePxRect.Right() + 1, aPagePxRect.Top() + mnShadowPxWidth - 1) ), aPageRightShadow ); + pOut-DrawBitmapEx( pOut-PixelToLogic( Point( aPaintRect.Right() + mnShadowPxWidth, aPagePxRect.Top() + mnShadowPxWidth - 1) ), aPageRightShadow ); Is this really correct? AFAICS it moves the shadow too much to the right... And if it is correct, why the corner shadows do not need to be adjusted too? Still because of the fact we've the 8px overlapping the adjacent border. I guess this picture http://misc.orniz.org/libreoffice/shadow-decomposition.png should make things clearer. As you can see, Paint rect is only used for corners shadow left/right adjustment Sébastien signature.asc Description: PGP signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice