vcl/workben/vcldemo.cxx |   19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

New commits:
commit 9299d425f3ed941d983f68d6dc1e979b4d4d1060
Author:     Hossein <hoss...@libreoffice.org>
AuthorDate: Wed Mar 12 13:50:51 2025 +0100
Commit:     Hossein <hoss...@libreoffice.org>
CommitDate: Wed Mar 12 15:37:26 2025 +0100

    Simplify string definition
    
    With Unicode literals, the code is now much simpler. This patch also
    corrects the text, which means 1 2 3 in Arabic.
    
    Change-Id: I59a6a3afcddde416f73e74287319750cf4111048
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182826
    Tested-by: Jenkins
    Reviewed-by: Hossein   <hoss...@libreoffice.org>

diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 1b3964384736..7d40251a46e3 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -389,28 +389,13 @@ public:
         {
             rDev.SetClipRegion( vcl::Region(r) );
 
-            OUString aText;
+            const OUString aText = bArabicText?u"واحِدٌ اثْنَانِ ثَلاثَةٌ"_ustr
+                                              :u"Click any rect to zoom!"_ustr;
 
             // To have more text displayed one after the other (overlapping, 
and in different colours), then
             // change this value
             const int nPrintNumCopies=1;
 
-            if (bArabicText)
-            {
-                const unsigned char pTextUTF8[] = {
-                    0xd9, 0x88, 0xd8, 0xa7, 0xd8, 0xad, 0xd9, 0x90,
-                    0xd8, 0xaf, 0xd9, 0x92, 0x20, 0xd8, 0xa5, 0xd8,
-                    0xab, 0xd9, 0x8d, 0xd9, 0x86, 0xd9, 0x8a, 0xd9,
-                    0x86, 0x20, 0xd8, 0xab, 0xd9, 0x84, 0xd8, 0xa7,
-                    0xd8, 0xab, 0xd8, 0xa9, 0xd9, 0x8c, 0x00
-                };
-                aText = OUString(reinterpret_cast<char const *>(pTextUTF8),
-                                 std::size( pTextUTF8 ) - 1,
-                                 RTL_TEXTENCODING_UTF8);
-            }
-            else
-                aText = "Click any rect to zoom!!!!";
-
             std::vector<OUString> aFontNames =
             {
                 u"Times"_ustr,

Reply via email to