LibreOffice Module svx (master)  1
charmap.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <vcl/event.hxx>
21 #include <vcl/fontcharmap.hxx>
22 #include <vcl/svapp.hxx>
23 #include <vcl/settings.hxx>
24 #include <vcl/virdev.hxx>
25 
26 #include <svx/ucsubset.hxx>
27 
28 
29 #include <svx/strings.hrc>
30 
31 #include <svx/charmap.hxx>
32 #include <svx/dialmgr.hxx>
33 
34 #include <charmapacc.hxx>
35 #include <uiobject.hxx>
36 
37 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
38 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
39 #include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp>
40 #include <com/sun/star/datatransfer/clipboard/SystemClipboard.hpp>
41 #include <officecfg/Office/Common.hxx>
43 #include <unicode/uchar.h>
44 #include <vcl/textview.hxx>
45 #include <rtl/ustrbuf.hxx>
46 
47 using namespace ::com::sun::star::accessibility;
48 using namespace ::com::sun::star::uno;
49 using namespace ::com::sun::star;
50 
52 {
53  static sal_uInt32 cSelectedChar = ' '; // keeps selected character over app lifetime
54  return cSelectedChar;
55 }
56 
58 {
60 }
61 
62 SvxShowCharSet::SvxShowCharSet(std::unique_ptr<weld::ScrolledWindow> pScrolledWindow, const VclPtr<VirtualDevice>& rVirDev)
63  : mxVirDev(rVirDev)
64  , mxScrollArea(std::move(pScrolledWindow))
66  , nX(0)
67  , nY(0)
68  , maFontSize(0, 0)
69  , maPosition(0,0)
70  , mbRecalculateFont(true)
71  , mbUpdateForeground(true)
72  , mbUpdateBackground(true)
73 {
74  init();
75 
76  mxScrollArea->set_user_managed_scrolling();
77 }
78 
80 {
81  CustomWidgetController::SetDrawingArea(pDrawingArea);
82 
83  Size aSize(COLUMN_COUNT * pDrawingArea->get_approximate_digit_width() * 5.25,
84  ROW_COUNT * pDrawingArea->get_text_height() * 2);
85 
86  nX = aSize.Width() / COLUMN_COUNT;
87  nY = aSize.Height() / ROW_COUNT;
88 
89  // tdf#121232 set a size request that will result in a 0 m_nXGap by default
90  mxScrollArea->set_size_request(COLUMN_COUNT * nX + mxScrollArea->get_vscroll_width() + 2,
91  ROW_COUNT * nY);
92 }
93 
95 {
96  nSelectedIndex = -1; // TODO: move into init list when it is no longer static
97  m_nXGap = 0;
98  m_nYGap = 0;
99 
100  mxScrollArea->connect_vadjustment_changed(LINK(this, SvxShowCharSet, VscrollHdl));
102  // other settings depend on selected font => see RecalculateFont
103 
104  bDrag = false;
105 }
106 
108 {
109  mbRecalculateFont = true;
110 }
111 
113 {
115 }
116 
118 {
120 }
121 
123 {
124  if ( rMEvt.IsLeft() )
125  {
126  if ( rMEvt.GetClicks() == 1 )
127  {
128  GrabFocus();
129  bDrag = true;
130  CaptureMouse();
131 
132  int nIndex = PixelToMapIndex( rMEvt.GetPosPixel() );
133  // Fire the focus event
134  SelectIndex( nIndex, true);
135  }
136 
137  if ( !(rMEvt.GetClicks() % 2) )
138  aDoubleClkHdl.Call( this );
139  }
140 
141  if (rMEvt.IsRight())
142  {
143  Point aPosition (rMEvt.GetPosPixel());
144  maPosition = aPosition;
145  int nIndex = PixelToMapIndex( rMEvt.GetPosPixel() );
146  // Fire the focus event
147  SelectIndex( nIndex, true);
149  }
150 
151  return true;
152 }
153 
155 {
156  if ( bDrag && rMEvt.IsLeft() )
157  {
158  // released mouse over character map
160  aSelectHdl.Call( this );
161  ReleaseMouse();
162  bDrag = false;
163  }
164 
165  return true;
166 }
167 
169 {
170  if ( rMEvt.IsLeft() && bDrag )
171  {
172  Point aPos = rMEvt.GetPosPixel();
173  Size aSize = GetOutputSizePixel();
174 
175  if ( aPos.X() < 0 )
176  aPos.setX( 0 );
177  else if ( aPos.X() > aSize.Width()-5 )
178  aPos.setX( aSize.Width()-5 );
179  if ( aPos.Y() < 0 )
180  aPos.setY( 0 );
181  else if ( aPos.Y() > aSize.Height()-5 )
182  aPos.setY( aSize.Height()-5 );
183 
184  int nIndex = PixelToMapIndex( aPos );
185  // Fire the focus event.
186  SelectIndex( nIndex, true );
187  }
188 
189  return true;
190 }
191 
192 sal_uInt16 SvxShowCharSet::GetRowPos(sal_uInt16 _nPos)
193 {
194  return _nPos / COLUMN_COUNT ;
195 }
196 
198 {
199  maFavCharList.clear();
200  maFavCharFontList.clear();
201  //retrieve recent character list
202  css::uno::Sequence< OUString > rFavCharList( officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterList::get() );
204 
205  //retrieve recent character font list
206  css::uno::Sequence< OUString > rFavCharFontList( officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterFontList::get() );
208 }
209 
210 bool SvxShowCharSet::isFavChar(const OUString& sTitle, const OUString& rFont)
211 {
212  auto isFavCharTitleExists = std::any_of(maFavCharList.begin(),
213  maFavCharList.end(),
214  [sTitle] (const OUString & a) { return a == sTitle; });
215 
216  auto isFavCharFontExists = std::any_of(maFavCharFontList.begin(),
217  maFavCharFontList.end(),
218  [rFont] (const OUString & a) { return a == rFont; });
219 
220  // if Fav char to be added is already in list, return true
221  return isFavCharTitleExists && isFavCharFontExists;
222 }
223 
225 {
226  std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDrawingArea(), "svx/ui/charsetmenu.ui"));
227  std::unique_ptr<weld::Menu> xItemMenu(xBuilder->weld_menu("charsetmenu"));
228 
229  sal_UCS4 cChar = GetSelectCharacter();
230  OUString aOUStr( &cChar, 1 );
231  if (isFavChar(aOUStr, mxVirDev->GetFont().GetFamilyName()) || maFavCharList.size() >= 16)
232  xItemMenu->set_visible("add", false);
233  else
234  xItemMenu->set_visible("remove", false);
235 
236  ContextMenuSelect(xItemMenu->popup_at_rect(GetDrawingArea(), tools::Rectangle(maPosition, Size(1,1))));
237  GrabFocus();
238  Invalidate();
239 }
240 
241 void SvxShowCharSet::ContextMenuSelect(const OString& rIdent)
242 {
243  sal_UCS4 cChar = GetSelectCharacter();
244  OUString aOUStr(&cChar, 1);
245 
246  if (rIdent == "insert")
247  aDoubleClkHdl.Call(this);
248  else if (rIdent == "add" || rIdent == "remove")
249  {
251  aFavClickHdl.Call(this);
252  }
253  else if (rIdent == "copy")
254  CopyToClipboard(aOUStr);
255 }
256 
257 void SvxShowCharSet::CopyToClipboard(const OUString& rOUStr)
258 {
259  css::uno::Reference<css::datatransfer::clipboard::XClipboard> xClipboard =
260  css::datatransfer::clipboard::SystemClipboard::create(comphelper::getProcessComponentContext());
261 
262  if (xClipboard.is())
263  {
264  TETextDataObject* pDataObj = new TETextDataObject(rOUStr);
265 
266  try
267  {
268  xClipboard->setContents( pDataObj, nullptr );
269 
270  css::uno::Reference<css::datatransfer::clipboard::XFlushableClipboard> xFlushableClipboard(xClipboard, css::uno::UNO_QUERY);
271  if( xFlushableClipboard.is() )
272  xFlushableClipboard->flushClipboard();
273  }
274  catch( const css::uno::Exception& )
275  {
276  }
277  }
278 }
279 
280 void SvxShowCharSet::updateFavCharacterList(const OUString& sTitle, const OUString& rFont)
281 {
282  if(isFavChar(sTitle, rFont))
283  {
284  auto itChar = std::find(maFavCharList.begin(), maFavCharList.end(), sTitle);
285  auto itChar2 = std::find(maFavCharFontList.begin(), maFavCharFontList.end(), rFont);
286 
287  // if Fav char to be added is already in list, remove it
288  if( itChar != maFavCharList.end() && itChar2 != maFavCharFontList.end() )
289  {
290  maFavCharList.erase( itChar );
291  maFavCharFontList.erase( itChar2);
292  }
293 
294  css::uno::Sequence< OUString > aFavCharList(maFavCharList.size());
295  css::uno::Sequence< OUString > aFavCharFontList(maFavCharFontList.size());
296 
297  for (size_t i = 0; i < maFavCharList.size(); ++i)
298  {
299  aFavCharList[i] = maFavCharList[i];
300  aFavCharFontList[i] = maFavCharFontList[i];
301  }
302 
303  std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(mxContext));
304  officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterList::set(aFavCharList, batch);
305  officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterFontList::set(aFavCharFontList, batch);
306  batch->commit();
307  return;
308  }
309 
310  auto itChar = std::find(maFavCharList.begin(), maFavCharList.end(), sTitle);
311  auto itChar2 = std::find(maFavCharFontList.begin(), maFavCharFontList.end(), rFont);
312 
313  // if Fav char to be added is already in list, remove it
314  if( itChar != maFavCharList.end() && itChar2 != maFavCharFontList.end() )
315  {
316  maFavCharList.erase( itChar );
317  maFavCharFontList.erase( itChar2);
318  }
319 
320  if (maFavCharList.size() == 16)
321  {
322  maFavCharList.pop_back();
323  maFavCharFontList.pop_back();
324  }
325 
326  maFavCharList.push_back(sTitle);
327  maFavCharFontList.push_back(rFont);
328 
329  css::uno::Sequence< OUString > aFavCharList(maFavCharList.size());
330  css::uno::Sequence< OUString > aFavCharFontList(maFavCharFontList.size());
331 
332  for (size_t i = 0; i < maFavCharList.size(); ++i)
333  {
334  aFavCharList[i] = maFavCharList[i];
335  aFavCharFontList[i] = maFavCharFontList[i];
336  }
337 
338  std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(mxContext));
339  officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterList::set(aFavCharList, batch);
340  officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterFontList::set(aFavCharFontList, batch);
341  batch->commit();
342 }
343 
344 sal_uInt16 SvxShowCharSet::GetColumnPos(sal_uInt16 _nPos)
345 {
346  return _nPos % COLUMN_COUNT ;
347 }
348 
350 {
351  return mxScrollArea->vadjustment_get_value() * COLUMN_COUNT;
352 }
353 
355 {
356  sal_uInt32 nIndex = FirstInView();
357  nIndex += ROW_COUNT * COLUMN_COUNT - 1;
358  sal_uInt32 nCompare = mxFontCharMap->GetCharCount() - 1;
359  if (nIndex > nCompare)
360  nIndex = nCompare;
361  return nIndex;
362 }
363 
365 {
366  const int nBase = FirstInView();
367  int x = ((nIndex - nBase) % COLUMN_COUNT) * nX;
368  int y = ((nIndex - nBase) / COLUMN_COUNT) * nY;
369  return Point( x + m_nXGap, y + m_nYGap );
370 }
371 
372 
373 int SvxShowCharSet::PixelToMapIndex( const Point& point) const
374 {
375  int nBase = FirstInView();
376  return (nBase + ((point.X() - m_nXGap)/nX) + ((point.Y() - m_nYGap)/nY) * COLUMN_COUNT);
377 }
378 
380 {
381  vcl::KeyCode aCode = rKEvt.GetKeyCode();
382 
383  if (aCode.GetModifier())
384  return false;
385 
386  bool bRet = true;
387 
388  int tmpSelected = nSelectedIndex;
389 
390  switch (aCode.GetCode())
391  {
392  case KEY_SPACE:
393  aSelectHdl.Call( this );
394  break;
395  case KEY_LEFT:
396  --tmpSelected;
397  break;
398  case KEY_RIGHT:
399  ++tmpSelected;
400  break;
401  case KEY_UP:
402  tmpSelected -= COLUMN_COUNT;
403  break;
404  case KEY_DOWN:
405  tmpSelected += COLUMN_COUNT;
406  break;
407  case KEY_PAGEUP:
408  tmpSelected -= ROW_COUNT * COLUMN_COUNT;
409  break;
410  case KEY_PAGEDOWN:
411  tmpSelected += ROW_COUNT * COLUMN_COUNT;
412  break;
413  case KEY_HOME:
414  tmpSelected = 0;
415  break;
416  case KEY_END:
417  tmpSelected = mxFontCharMap->GetCharCount() - 1;
418  break;
419  case KEY_TAB: // some fonts have a character at these unicode control codes
420  case KEY_ESCAPE:
421  case KEY_RETURN:
422  tmpSelected = - 1; // mark as invalid
423  bRet = false;
424  break;
425  default:
426  {
427  sal_UCS4 cChar = rKEvt.GetCharCode();
428  sal_UCS4 cNext = mxFontCharMap->GetNextChar(cChar - 1);
429  tmpSelected = mxFontCharMap->GetIndexFromChar(cNext);
430  if (tmpSelected < 0 || (cChar != cNext))
431  {
432  tmpSelected = - 1; // mark as invalid
433  bRet = false;
434  }
435  break;
436  }
437  }
438 
439  if ( tmpSelected >= 0 )
440  {
441  SelectIndex( tmpSelected, true );
442  aPreSelectHdl.Call( this );
443  }
444 
445  return bRet;
446 }
447 
449 {
450  InitSettings(rRenderContext);
451  RecalculateFont(rRenderContext);
452  DrawChars_Impl(rRenderContext, FirstInView(), LastInView());
453 }
454 
455 void SvxShowCharSet::SetFont( const vcl::Font& rFont )
456 {
457  maFont = rFont;
458  mbRecalculateFont = true;
459  Invalidate();
460 }
461 
463 {
464  Invalidate();
465 }
466 
467 // stretch a grid rectangle if its at the edge to fill unused space
468 tools::Rectangle SvxShowCharSet::getGridRectangle(const Point &rPointUL, const Size &rOutputSize)
469 {
470  long x = rPointUL.X() - 1;
471  long y = rPointUL.Y() - 1;
472  Point aPointUL(x+1, y+1);
473  Size aGridSize(nX-1, nY-1);
474 
475  long nXDistFromLeft = x - m_nXGap;
476  if (nXDistFromLeft <= 1)
477  {
478  aPointUL.setX( 1 );
479  aGridSize.AdjustWidth(m_nXGap + nXDistFromLeft );
480  }
481  long nXDistFromRight = rOutputSize.Width() - m_nXGap - nX - x;
482  if (nXDistFromRight <= 1)
483  aGridSize.AdjustWidth(m_nXGap + nXDistFromRight );
484 
485  long nXDistFromTop = y - m_nYGap;
486  if (nXDistFromTop <= 1)
487  {
488  aPointUL.setY( 1 );
489  aGridSize.AdjustHeight(m_nYGap + nXDistFromTop );
490  }
491  long nXDistFromBottom = rOutputSize.Height() - m_nYGap - nY - y;
492  if (nXDistFromBottom <= 1)
493  aGridSize.AdjustHeight(m_nYGap + nXDistFromBottom );
494 
495  return tools::Rectangle(aPointUL, aGridSize);
496 }
497 
498 void SvxShowCharSet::DrawChars_Impl(vcl::RenderContext& rRenderContext, int n1, int n2)
499 {
500  if (n1 > LastInView() || n2 < FirstInView())
501  return;
502 
503  Size aOutputSize(GetOutputSizePixel());
504 
505  int i;
506  for (i = 1; i < COLUMN_COUNT; ++i)
507  {
508  rRenderContext.DrawLine(Point(nX * i + m_nXGap, 0),
509  Point(nX * i + m_nXGap, aOutputSize.Height()));
510  }
511  for (i = 1; i < ROW_COUNT; ++i)
512  {
513  rRenderContext.DrawLine(Point(0, nY * i + m_nYGap),
514  Point(aOutputSize.Width(), nY * i + m_nYGap));
515  }
516  const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
517  const Color aWindowTextColor(rStyleSettings.GetFieldTextColor());
518  Color aHighlightColor(rStyleSettings.GetHighlightColor());
519  Color aHighlightTextColor(rStyleSettings.GetHighlightTextColor());
520  Color aFaceColor(rStyleSettings.GetFaceColor());
521  Color aLightColor(rStyleSettings.GetLightColor());
522  Color aShadowColor(rStyleSettings.GetShadowColor());
523 
524  int nTextHeight = rRenderContext.GetTextHeight();
525  tools::Rectangle aBoundRect;
526  for (i = n1; i <= n2; ++i)
527  {
528  Point pix = MapIndexToPixel(i);
529  int x = pix.X();
530  int y = pix.Y();
531 
533  OUString aCharStr(&nChar, 1);
534  int nTextWidth = rRenderContext.GetTextWidth(aCharStr);
535  int tx = x + (nX - nTextWidth + 1) / 2;
536  int ty = y + (nY - nTextHeight + 1) / 2;
537  Point aPointTxTy(tx, ty);
538 
539  // adjust position before it gets out of bounds
540  if (rRenderContext.GetTextBoundRect(aBoundRect, aCharStr) && !aBoundRect.IsEmpty())
541  {
542  // zero advance width => use ink width to center glyph
543  if (!nTextWidth)
544  {
545  aPointTxTy.setX( x - aBoundRect.Left() + (nX - aBoundRect.GetWidth() + 1) / 2 );
546  }
547 
548  aBoundRect += aPointTxTy;
549 
550  // shift back vertically if needed
551  int nYLDelta = aBoundRect.Top() - y;
552  int nYHDelta = (y + nY) - aBoundRect.Bottom();
553  if (nYLDelta <= 0)
554  aPointTxTy.AdjustY( -(nYLDelta - 1) );
555  else if (nYHDelta <= 0)
556  aPointTxTy.AdjustY(nYHDelta - 1 );
557 
558  // shift back horizontally if needed
559  int nXLDelta = aBoundRect.Left() - x;
560  int nXHDelta = (x + nX) - aBoundRect.Right();
561  if (nXLDelta <= 0)
562  aPointTxTy.AdjustX( -(nXLDelta - 1) );
563  else if (nXHDelta <= 0)
564  aPointTxTy.AdjustX(nXHDelta - 1 );
565  }
566 
567  Color aTextCol = rRenderContext.GetTextColor();
568  if (i != nSelectedIndex)
569  {
570  rRenderContext.SetTextColor(aWindowTextColor);
571  rRenderContext.DrawText(aPointTxTy, aCharStr);
572  }
573  else
574  {
575  Color aLineCol = rRenderContext.GetLineColor();
576  Color aFillCol = rRenderContext.GetFillColor();
577  rRenderContext.SetLineColor();
578  Point aPointUL(x + 1, y + 1);
579  if (HasFocus())
580  {
581  rRenderContext.SetFillColor(aHighlightColor);
582  rRenderContext.DrawRect(getGridRectangle(aPointUL, aOutputSize));
583 
584  rRenderContext.SetTextColor(aHighlightTextColor);
585  rRenderContext.DrawText(aPointTxTy, aCharStr);
586  }
587  else
588  {
589  rRenderContext.SetFillColor(aFaceColor);
590  rRenderContext.DrawRect(getGridRectangle(aPointUL, aOutputSize));
591 
592  rRenderContext.SetLineColor(aLightColor);
593  rRenderContext.DrawLine(aPointUL, Point(x + nX - 1, y + 1));
594  rRenderContext.DrawLine(aPointUL, Point(x + 1, y + nY - 1));
595 
596  rRenderContext.SetLineColor(aShadowColor);
597  rRenderContext.DrawLine(Point(x + 1, y + nY - 1), Point(x + nX - 1, y + nY - 1));
598  rRenderContext.DrawLine(Point(x + nX - 1, y + nY - 1), Point(x + nX - 1, y + 1));
599 
600  rRenderContext.DrawText(aPointTxTy, aCharStr);
601  }
602  rRenderContext.SetLineColor(aLineCol);
603  rRenderContext.SetFillColor(aFillCol);
604  }
605  rRenderContext.SetTextColor(aTextCol);
606  }
607 }
608 
609 
611 {
612  const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
613 
614  if (mbUpdateForeground)
615  {
616  rRenderContext.SetTextColor(rStyleSettings.GetDialogTextColor());
617  mbUpdateForeground = false;
618  }
619 
620  if (mbUpdateBackground)
621  {
622  rRenderContext.SetBackground(rStyleSettings.GetWindowColor());
623  rRenderContext.Erase();
624  mbUpdateBackground = false;
625  }
626 
627  vcl::Font aFont(maFont);
628  aFont.SetWeight(WEIGHT_LIGHT);
629  aFont.SetAlignment(ALIGN_TOP);
630  aFont.SetFontSize(maFontSize);
631  aFont.SetTransparent(true);
632  rRenderContext.SetFont(aFont);
633 }
634 
636 {
637  if( nSelectedIndex >= 0 )
639  return getSelectedChar();
640 }
641 
642 
644 {
645  if (!mbRecalculateFont)
646  return;
647 
648  // save last selected unicode
649  if (nSelectedIndex >= 0)
651 
652  Size aSize(GetOutputSizePixel());
653 
654  vcl::Font aFont = maFont;
655  aFont.SetWeight(WEIGHT_LIGHT);
656  aFont.SetAlignment(ALIGN_TOP);
657  int nFontHeight = (aSize.Height() - 5) * 2 / (3 * ROW_COUNT);
658  maFontSize = rRenderContext.PixelToLogic(Size(0, nFontHeight));
659  aFont.SetFontSize(maFontSize);
660  aFont.SetTransparent(true);
661  rRenderContext.SetFont(aFont);
662  rRenderContext.GetFontCharMap(mxFontCharMap);
664 
665  nX = aSize.Width() / COLUMN_COUNT;
666  nY = aSize.Height() / ROW_COUNT;
667 
668  const int nLastRow = (mxFontCharMap->GetCharCount() - 1 + COLUMN_COUNT) / COLUMN_COUNT;
669  mxScrollArea->vadjustment_configure(mxScrollArea->vadjustment_get_value(), 0, nLastRow, 1, ROW_COUNT - 1, ROW_COUNT);
670 
671  // restore last selected unicode
672  int nMapIndex = mxFontCharMap->GetIndexFromChar(getSelectedChar());
673  if (nMapIndex != nSelectedIndex)
674  SelectIndex(nMapIndex);
675 
676  // rearrange CharSet element in sync with nX- and nY-multiples
677  Size aDrawSize(nX * COLUMN_COUNT, nY * ROW_COUNT);
678  m_nXGap = (aSize.Width() - aDrawSize.Width()) / 2;
679  m_nYGap = (aSize.Height() - aDrawSize.Height()) / 2;
680 
681  mbRecalculateFont = false;
682 }
683 
684 void SvxShowCharSet::SelectIndex(int nNewIndex, bool bFocus)
685 {
686  if (!mxFontCharMap.is())
688 
689  if( nNewIndex < 0 )
690  {
691  // need to scroll see closest unicode
692  sal_uInt32 cPrev = mxFontCharMap->GetPrevChar( getSelectedChar() );
693  int nMapIndex = mxFontCharMap->GetIndexFromChar( cPrev );
694  int nNewPos = nMapIndex / COLUMN_COUNT;
695  mxScrollArea->vadjustment_set_value(nNewPos);
696  nSelectedIndex = bFocus ? nMapIndex+1 : -1;
697  Invalidate();
698  }
699  else if( nNewIndex < FirstInView() )
700  {
701  // need to scroll up to see selected item
702  int nOldPos = mxScrollArea->vadjustment_get_value();
703  int nDelta = (FirstInView() - nNewIndex + COLUMN_COUNT-1) / COLUMN_COUNT;
704  mxScrollArea->vadjustment_set_value(nOldPos - nDelta);
705  nSelectedIndex = nNewIndex;
706  Invalidate();
707  }
708  else if( nNewIndex > LastInView() )
709  {
710  // need to scroll down to see selected item
711  int nOldPos = mxScrollArea->vadjustment_get_value();
712  int nDelta = (nNewIndex - LastInView() + COLUMN_COUNT) / COLUMN_COUNT;
713  mxScrollArea->vadjustment_set_value(nOldPos + nDelta);
714  if( nNewIndex < mxFontCharMap->GetCharCount() )
715  {
716  nSelectedIndex = nNewIndex;
717  Invalidate();
718  }
719  else if (nOldPos != mxScrollArea->vadjustment_get_value())
720  {
721  Invalidate();
722  }
723  }
724  else
725  {
726  nSelectedIndex = nNewIndex;
727  Invalidate();
728  }
729 
730  if( nSelectedIndex >= 0 )
731  {
733  if( m_xAccessible.is() )
734  {
736  // Don't fire the focus event.
737  if ( bFocus )
738  m_xAccessible->fireEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, Any(), makeAny(pItem->GetAccessible()) ); // this call assures that m_pItem is set
739  else
740  m_xAccessible->fireEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED_NOFOCUS, Any(), makeAny(pItem->GetAccessible()) ); // this call assures that m_pItem is set
741 
742  assert(pItem->m_xItem.is() && "No accessible created!");
743  Any aOldAny, aNewAny;
744  aNewAny <<= AccessibleStateType::FOCUSED;
745  // Don't fire the focus event.
746  if ( bFocus )
747  pItem->m_xItem->fireEvent( AccessibleEventId::STATE_CHANGED, aOldAny, aNewAny );
748 
749  aNewAny <<= AccessibleStateType::SELECTED;
750  pItem->m_xItem->fireEvent( AccessibleEventId::STATE_CHANGED, aOldAny, aNewAny );
751  }
752  }
753  aHighHdl.Call( this );
754 }
755 
756 void SvxShowCharSet::OutputIndex( int nNewIndex )
757 {
758  SelectIndex( nNewIndex, true );
759  aSelectHdl.Call( this );
760 }
761 
762 
764 {
765  if ( !mxFontCharMap.is() )
767 
768  // get next available char of current font
769  sal_UCS4 cNext = mxFontCharMap->GetNextChar( (cNew > 0) ? cNew - 1 : cNew );
770 
771  int nMapIndex = mxFontCharMap->GetIndexFromChar( cNext );
772  SelectIndex( nMapIndex );
773  // move selected item to top row if not in focus
774  mxScrollArea->vadjustment_set_value(nMapIndex / COLUMN_COUNT);
775  Invalidate();
776 }
777 
779 {
780  if( nSelectedIndex < FirstInView() )
781  {
782  SelectIndex( FirstInView() + (nSelectedIndex % COLUMN_COUNT) );
783  }
784  else if( nSelectedIndex > LastInView() )
785  {
786  if( m_xAccessible.is() )
787  {
788  css::uno::Any aOldAny, aNewAny;
789  int nLast = LastInView();
790  for ( ; nLast != nSelectedIndex; ++nLast)
791  {
792  aOldAny <<= ImplGetItem(nLast)->GetAccessible();
793  m_xAccessible ->fireEvent( AccessibleEventId::CHILD, aOldAny, aNewAny );
794  }
795  }
796  SelectIndex( (LastInView() - COLUMN_COUNT + 1) + (nSelectedIndex % COLUMN_COUNT) );
797  }
798 
799  Invalidate();
800 }
801 
803 {
804  if (m_xAccessible.is())
805  {
806  m_aItems.clear();
807  m_xAccessible->clearCharSetControl();
808  m_xAccessible.clear();
809  }
810 }
811 
812 css::uno::Reference< XAccessible > SvxShowCharSet::CreateAccessible()
813 {
814  OSL_ENSURE(!m_xAccessible.is(),"Accessible already created!");
816  return m_xAccessible.get();
817 }
818 
820 {
821  ItemsMap::iterator aFind = m_aItems.find(_nPos);
822  if ( aFind == m_aItems.end() )
823  {
824  OSL_ENSURE(m_xAccessible.is(), "Who wants to create a child of my table without a parent?");
825  auto xItem = std::make_shared<svx::SvxShowCharSetItem>(*this,
826  m_xAccessible.get(), sal::static_int_cast< sal_uInt16 >(_nPos));
827  aFind = m_aItems.emplace(_nPos, xItem).first;
828  OUStringBuffer buf;
829  buf.appendUtf32( mxFontCharMap->GetCharFromIndex( _nPos ) );
830  aFind->second->maText = buf.makeStringAndClear();
831  Point pix = MapIndexToPixel( _nPos );
832  aFind->second->maRect = tools::Rectangle( Point( pix.X() + 1, pix.Y() + 1 ), Size(nX-1,nY-1) );
833  }
834 
835  return aFind->second.get();
836 }
837 
839 {
840  return mxFontCharMap->GetCharCount();
841 }
842 
844 {
846  return mxFontCharMap;
847 }
848 
849 // TODO: should be moved into Font Attributes stuff
850 // we let it mature here though because it is currently the only use
851 
852 SubsetMap::SubsetMap( const FontCharMapRef& rxFontCharMap )
853 {
854  InitList();
855  ApplyCharMap(rxFontCharMap);
856 }
857 
859 {
860  return maSubsets;
861 }
862 
864 {
865  for (auto const& subset : maSubsets)
866  if( (subset.GetRangeMin() <= cChar) && (cChar <= subset.GetRangeMax()) )
867  return &subset;
868  return nullptr;
869 }
870 
871 inline Subset::Subset(sal_UCS4 nMin, sal_UCS4 nMax, const OUString& rName)
872 : mnRangeMin(nMin), mnRangeMax(nMax), maRangeName(rName)
873 {
874 }
875 
877 {
878  static SubsetVec s_aAllSubsets = [&]()
879  {
880  SubsetVec aAllSubsets;
881  //I wish icu had a way to give me the block ranges
882  for (int i = UBLOCK_BASIC_LATIN; i < UBLOCK_COUNT; ++i)
883  {
884  UBlockCode eBlock = static_cast<UBlockCode>(i);
885  switch (eBlock)
886  {
887  case UBLOCK_NO_BLOCK:
888  case UBLOCK_INVALID_CODE:
889  case UBLOCK_COUNT:
890  case UBLOCK_HIGH_SURROGATES:
891  case UBLOCK_HIGH_PRIVATE_USE_SURROGATES:
892  case UBLOCK_LOW_SURROGATES:
893  break;
894  case UBLOCK_BASIC_LATIN:
895  aAllSubsets.emplace_back( 0x0000, 0x007F, SvxResId(RID_SUBSETSTR_BASIC_LATIN) );
896  break;
897  case UBLOCK_LATIN_1_SUPPLEMENT:
898  aAllSubsets.emplace_back( 0x0080, 0x00FF, SvxResId(RID_SUBSETSTR_LATIN_1) );
899  break;
900  case UBLOCK_LATIN_EXTENDED_A:
901  aAllSubsets.emplace_back( 0x0100, 0x017F, SvxResId(RID_SUBSETSTR_LATIN_EXTENDED_A) );
902  break;
903  case UBLOCK_LATIN_EXTENDED_B:
904  aAllSubsets.emplace_back( 0x0180, 0x024F, SvxResId(RID_SUBSETSTR_LATIN_EXTENDED_B) );
905  break;
906  case UBLOCK_IPA_EXTENSIONS:
907  aAllSubsets.emplace_back( 0x0250, 0x02AF, SvxResId(RID_SUBSETSTR_IPA_EXTENSIONS) );
908  break;
909  case UBLOCK_SPACING_MODIFIER_LETTERS:
910  aAllSubsets.emplace_back( 0x02B0, 0x02FF, SvxResId(RID_SUBSETSTR_SPACING_MODIFIERS) );
911  break;
912  case UBLOCK_COMBINING_DIACRITICAL_MARKS:
913  aAllSubsets.emplace_back( 0x0300, 0x036F, SvxResId(RID_SUBSETSTR_COMB_DIACRITICAL) );
914  break;
915  case UBLOCK_GREEK:
916  aAllSubsets.emplace_back( 0x0370, 0x03FF, SvxResId(RID_SUBSETSTR_BASIC_GREEK) );
917  break;
918  case UBLOCK_CYRILLIC:
919  aAllSubsets.emplace_back( 0x0400, 0x04FF, SvxResId(RID_SUBSETSTR_CYRILLIC) );
920  break;
921  case UBLOCK_ARMENIAN:
922  aAllSubsets.emplace_back( 0x0530, 0x058F, SvxResId(RID_SUBSETSTR_ARMENIAN) );
923  break;
924  case UBLOCK_HEBREW:
925  aAllSubsets.emplace_back( 0x0590, 0x05FF, SvxResId(RID_SUBSETSTR_BASIC_HEBREW) );
926  break;
927  case UBLOCK_ARABIC:
928  aAllSubsets.emplace_back( 0x0600, 0x065F, SvxResId(RID_SUBSETSTR_BASIC_ARABIC) );
929  break;
930  case UBLOCK_SYRIAC:
931  aAllSubsets.emplace_back( 0x0700, 0x074F, SvxResId(RID_SUBSETSTR_SYRIAC) );
932  break;
933  case UBLOCK_THAANA:
934  aAllSubsets.emplace_back( 0x0780, 0x07BF, SvxResId(RID_SUBSETSTR_THAANA) );
935  break;
936  case UBLOCK_DEVANAGARI:
937  aAllSubsets.emplace_back( 0x0900, 0x097F, SvxResId(RID_SUBSETSTR_DEVANAGARI) );
938  break;
939  case UBLOCK_BENGALI:
940  aAllSubsets.emplace_back( 0x0980, 0x09FF, SvxResId(RID_SUBSETSTR_BENGALI) );
941  break;
942  case UBLOCK_GURMUKHI:
943  aAllSubsets.emplace_back( 0x0A00, 0x0A7F, SvxResId(RID_SUBSETSTR_GURMUKHI) );
944  break;
945  case UBLOCK_GUJARATI:
946  aAllSubsets.emplace_back( 0x0A80, 0x0AFF, SvxResId(RID_SUBSETSTR_GUJARATI) );
947  break;
948  case UBLOCK_ORIYA:
949  aAllSubsets.emplace_back( 0x0B00, 0x0B7F, SvxResId(RID_SUBSETSTR_ODIA) );
950  break;
951  case UBLOCK_TAMIL:
952  aAllSubsets.emplace_back( 0x0B80, 0x0BFF, SvxResId(RID_SUBSETSTR_TAMIL) );
953  break;
954  case UBLOCK_TELUGU:
955  aAllSubsets.emplace_back( 0x0C00, 0x0C7F, SvxResId(RID_SUBSETSTR_TELUGU) );
956  break;
957  case UBLOCK_KANNADA:
958  aAllSubsets.emplace_back( 0x0C80, 0x0CFF, SvxResId(RID_SUBSETSTR_KANNADA) );
959  break;
960  case UBLOCK_MALAYALAM:
961  aAllSubsets.emplace_back( 0x0D00, 0x0D7F, SvxResId(RID_SUBSETSTR_MALAYALAM) );
962  break;
963  case UBLOCK_SINHALA:
964  aAllSubsets.emplace_back( 0x0D80, 0x0DFF, SvxResId(RID_SUBSETSTR_SINHALA) );
965  break;
966  case UBLOCK_THAI:
967  aAllSubsets.emplace_back( 0x0E00, 0x0E7F, SvxResId(RID_SUBSETSTR_THAI) );
968  break;
969  case UBLOCK_LAO:
970  aAllSubsets.emplace_back( 0x0E80, 0x0EFF, SvxResId(RID_SUBSETSTR_LAO) );
971  break;
972  case UBLOCK_TIBETAN:
973  aAllSubsets.emplace_back( 0x0F00, 0x0FBF, SvxResId(RID_SUBSETSTR_TIBETAN) );
974  break;
975  case UBLOCK_MYANMAR:
976  aAllSubsets.emplace_back( 0x1000, 0x109F, SvxResId(RID_SUBSETSTR_MYANMAR) );
977  break;
978  case UBLOCK_GEORGIAN:
979  aAllSubsets.emplace_back( 0x10A0, 0x10FF, SvxResId(RID_SUBSETSTR_BASIC_GEORGIAN) );
980  break;
981  case UBLOCK_HANGUL_JAMO:
982  aAllSubsets.emplace_back( 0x1100, 0x11FF, SvxResId(RID_SUBSETSTR_HANGUL_JAMO) );
983  break;
984  case UBLOCK_ETHIOPIC:
985  aAllSubsets.emplace_back( 0x1200, 0x137F, SvxResId(RID_SUBSETSTR_ETHIOPIC) );
986  break;
987  case UBLOCK_CHEROKEE:
988  aAllSubsets.emplace_back( 0x13A0, 0x13FF, SvxResId(RID_SUBSETSTR_CHEROKEE) );
989  break;
990  case UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS:
991  aAllSubsets.emplace_back( 0x1400, 0x167F, SvxResId(RID_SUBSETSTR_CANADIAN_ABORIGINAL) );
992  break;
993  case UBLOCK_OGHAM:
994  aAllSubsets.emplace_back( 0x1680, 0x169F, SvxResId(RID_SUBSETSTR_OGHAM) );
995  break;
996  case UBLOCK_RUNIC:
997  aAllSubsets.emplace_back( 0x16A0, 0x16F0, SvxResId(RID_SUBSETSTR_RUNIC) );
998  break;
999  case UBLOCK_KHMER:
1000  aAllSubsets.emplace_back( 0x1780, 0x17FF, SvxResId(RID_SUBSETSTR_KHMER) );
1001  break;
1002  case UBLOCK_MONGOLIAN:
1003  aAllSubsets.emplace_back( 0x1800, 0x18AF, SvxResId(RID_SUBSETSTR_MONGOLIAN) );
1004  break;
1005  case UBLOCK_LATIN_EXTENDED_ADDITIONAL:
1006  aAllSubsets.emplace_back( 0x1E00, 0x1EFF, SvxResId(RID_SUBSETSTR_LATIN_EXTENDED_ADDS) );
1007  break;
1008  case UBLOCK_GREEK_EXTENDED:
1009  aAllSubsets.emplace_back( 0x1F00, 0x1FFF, SvxResId(RID_SUBSETSTR_GREEK_EXTENDED) );
1010  break;
1011  case UBLOCK_GENERAL_PUNCTUATION:
1012  aAllSubsets.emplace_back( 0x2000, 0x206F, SvxResId(RID_SUBSETSTR_GENERAL_PUNCTUATION) );
1013  break;
1014  case UBLOCK_SUPERSCRIPTS_AND_SUBSCRIPTS:
1015  aAllSubsets.emplace_back( 0x2070, 0x209F, SvxResId(RID_SUBSETSTR_SUB_SUPER_SCRIPTS) );
1016  break;
1017  case UBLOCK_CURRENCY_SYMBOLS:
1018  aAllSubsets.emplace_back( 0x20A0, 0x20CF, SvxResId(RID_SUBSETSTR_CURRENCY_SYMBOLS) );
1019  break;
1020  case UBLOCK_COMBINING_MARKS_FOR_SYMBOLS:
1021  aAllSubsets.emplace_back( 0x20D0, 0x20FF, SvxResId(RID_SUBSETSTR_COMB_DIACRITIC_SYMS) );
1022  break;
1023  case UBLOCK_LETTERLIKE_SYMBOLS:
1024  aAllSubsets.emplace_back( 0x2100, 0x214F, SvxResId(RID_SUBSETSTR_LETTERLIKE_SYMBOLS) );
1025  break;
1026  case UBLOCK_NUMBER_FORMS:
1027  aAllSubsets.emplace_back( 0x2150, 0x218F, SvxResId(RID_SUBSETSTR_NUMBER_FORMS) );
1028  break;
1029  case UBLOCK_ARROWS:
1030  aAllSubsets.emplace_back( 0x2190, 0x21FF, SvxResId(RID_SUBSETSTR_ARROWS) );
1031  break;
1032  case UBLOCK_MATHEMATICAL_OPERATORS:
1033  aAllSubsets.emplace_back( 0x2200, 0x22FF, SvxResId(RID_SUBSETSTR_MATH_OPERATORS) );
1034  break;
1035  case UBLOCK_MISCELLANEOUS_TECHNICAL:
1036  aAllSubsets.emplace_back( 0x2300, 0x23FF, SvxResId(RID_SUBSETSTR_MISC_TECHNICAL) );
1037  break;
1038  case UBLOCK_CONTROL_PICTURES:
1039  aAllSubsets.emplace_back( 0x2400, 0x243F, SvxResId(RID_SUBSETSTR_CONTROL_PICTURES) );
1040  break;
1041  case UBLOCK_OPTICAL_CHARACTER_RECOGNITION:
1042  aAllSubsets.emplace_back( 0x2440, 0x245F, SvxResId(RID_SUBSETSTR_OPTICAL_CHAR_REC) );
1043  break;
1044  case UBLOCK_ENCLOSED_ALPHANUMERICS:
1045  aAllSubsets.emplace_back( 0x2460, 0x24FF, SvxResId(RID_SUBSETSTR_ENCLOSED_ALPHANUM) );
1046  break;
1047  case UBLOCK_BOX_DRAWING:
1048  aAllSubsets.emplace_back( 0x2500, 0x257F, SvxResId(RID_SUBSETSTR_BOX_DRAWING) );
1049  break;
1050  case UBLOCK_BLOCK_ELEMENTS:
1051  aAllSubsets.emplace_back( 0x2580, 0x259F, SvxResId(RID_SUBSETSTR_BLOCK_ELEMENTS) );
1052  break;
1053  case UBLOCK_GEOMETRIC_SHAPES:
1054  aAllSubsets.emplace_back( 0x25A0, 0x25FF, SvxResId(RID_SUBSETSTR_GEOMETRIC_SHAPES) );
1055  break;
1056  case UBLOCK_MISCELLANEOUS_SYMBOLS:
1057  aAllSubsets.emplace_back( 0x2600, 0x26FF, SvxResId(RID_SUBSETSTR_MISC_DINGBATS) );
1058  break;
1059  case UBLOCK_DINGBATS:
1060  aAllSubsets.emplace_back( 0x2700, 0x27BF, SvxResId(RID_SUBSETSTR_DINGBATS) );
1061  break;
1062  case UBLOCK_BRAILLE_PATTERNS:
1063  aAllSubsets.emplace_back( 0x2800, 0x28FF, SvxResId(RID_SUBSETSTR_BRAILLE_PATTERNS) );
1064  break;
1065  case UBLOCK_CJK_RADICALS_SUPPLEMENT:
1066  aAllSubsets.emplace_back( 0x2E80, 0x2EFF, SvxResId(RID_SUBSETSTR_CJK_RADICAL_SUPPL) );
1067  break;
1068  case UBLOCK_KANGXI_RADICALS:
1069  aAllSubsets.emplace_back( 0x2F00, 0x2FDF, SvxResId(RID_SUBSETSTR_KANGXI_RADICALS) );
1070  break;
1071  case UBLOCK_IDEOGRAPHIC_DESCRIPTION_CHARACTERS:
1072  aAllSubsets.emplace_back( 0x2FF0, 0x2FFF, SvxResId(RID_SUBSETSTR_IDEO_DESC_CHARS) );
1073  break;
1074  case UBLOCK_CJK_SYMBOLS_AND_PUNCTUATION:
1075  aAllSubsets.emplace_back( 0x3000, 0x303F, SvxResId(RID_SUBSETSTR_CJK_SYMS_PUNCTUATION) );
1076  break;
1077  case UBLOCK_HIRAGANA:
1078  aAllSubsets.emplace_back( 0x3040, 0x309F, SvxResId(RID_SUBSETSTR_HIRAGANA) );
1079  break;
1080  case UBLOCK_KATAKANA:
1081  aAllSubsets.emplace_back( 0x30A0, 0x30FF, SvxResId(RID_SUBSETSTR_KATAKANA) );
1082  break;
1083  case UBLOCK_BOPOMOFO:
1084  aAllSubsets.emplace_back( 0x3100, 0x312F, SvxResId(RID_SUBSETSTR_BOPOMOFO) );
1085  break;
1086  case UBLOCK_HANGUL_COMPATIBILITY_JAMO:
1087  aAllSubsets.emplace_back( 0x3130, 0x318F, SvxResId(RID_SUBSETSTR_HANGUL_COMPAT_JAMO) );
1088  break;
1089  case UBLOCK_KANBUN:
1090  aAllSubsets.emplace_back( 0x3190, 0x319F, SvxResId(RID_SUBSETSTR_KANBUN) );
1091  break;
1092  case UBLOCK_BOPOMOFO_EXTENDED:
1093  aAllSubsets.emplace_back( 0x31A0, 0x31BF, SvxResId(RID_SUBSETSTR_BOPOMOFO_EXTENDED) );
1094  break;
1095  case UBLOCK_ENCLOSED_CJK_LETTERS_AND_MONTHS:
1096  aAllSubsets.emplace_back( 0x3200, 0x32FF, SvxResId(RID_SUBSETSTR_ENCLOSED_CJK_LETTERS) );
1097  break;
1098  case UBLOCK_CJK_COMPATIBILITY:
1099  aAllSubsets.emplace_back( 0x3300, 0x33FF, SvxResId(RID_SUBSETSTR_CJK_COMPATIBILITY) );
1100  break;
1101  case UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A:
1102  aAllSubsets.emplace_back( 0x3400, 0x4DBF, SvxResId(RID_SUBSETSTR_CJK_EXT_A_UNIFIED_IDGRAPH) );
1103  break;
1104  case UBLOCK_CJK_UNIFIED_IDEOGRAPHS:
1105  aAllSubsets.emplace_back( 0x4E00, 0x9FA5, SvxResId(RID_SUBSETSTR_CJK_UNIFIED_IDGRAPH) );
1106  break;
1107  case UBLOCK_YI_SYLLABLES:
1108  aAllSubsets.emplace_back( 0xA000, 0xA48F, SvxResId(RID_SUBSETSTR_YI_SYLLABLES) );
1109  break;
1110  case UBLOCK_YI_RADICALS:
1111  aAllSubsets.emplace_back( 0xA490, 0xA4CF, SvxResId(RID_SUBSETSTR_YI_RADICALS) );
1112  break;
1113  case UBLOCK_HANGUL_SYLLABLES:
1114  aAllSubsets.emplace_back( 0xAC00, 0xD7AF, SvxResId(RID_SUBSETSTR_HANGUL) );
1115  break;
1116  case UBLOCK_PRIVATE_USE_AREA:
1117  aAllSubsets.emplace_back( 0xE000, 0xF8FF, SvxResId(RID_SUBSETSTR_PRIVATE_USE_AREA) );
1118  break;
1119  case UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS:
1120  aAllSubsets.emplace_back( 0xF900, 0xFAFF, SvxResId(RID_SUBSETSTR_CJK_COMPAT_IDGRAPHS) );
1121  break;
1122  case UBLOCK_ALPHABETIC_PRESENTATION_FORMS:
1123  aAllSubsets.emplace_back( 0xFB00, 0xFB4F, SvxResId(RID_SUBSETSTR_ALPHA_PRESENTATION) );
1124  break;
1125  case UBLOCK_ARABIC_PRESENTATION_FORMS_A:
1126  aAllSubsets.emplace_back( 0xFB50, 0xFDFF, SvxResId(RID_SUBSETSTR_ARABIC_PRESENT_A) );
1127  break;
1128  case UBLOCK_COMBINING_HALF_MARKS:
1129  aAllSubsets.emplace_back( 0xFE20, 0xFE2F, SvxResId(RID_SUBSETSTR_COMBINING_HALF_MARKS) );
1130  break;
1131  case UBLOCK_CJK_COMPATIBILITY_FORMS:
1132  aAllSubsets.emplace_back( 0xFE30, 0xFE4F, SvxResId(RID_SUBSETSTR_CJK_COMPAT_FORMS) );
1133  break;
1134  case UBLOCK_SMALL_FORM_VARIANTS:
1135  aAllSubsets.emplace_back( 0xFE50, 0xFE6F, SvxResId(RID_SUBSETSTR_SMALL_FORM_VARIANTS) );
1136  break;
1137  case UBLOCK_ARABIC_PRESENTATION_FORMS_B:
1138  aAllSubsets.emplace_back( 0xFE70, 0xFEFF, SvxResId(RID_SUBSETSTR_ARABIC_PRESENT_B) );
1139  break;
1140  case UBLOCK_SPECIALS:
1141  aAllSubsets.emplace_back( 0xFFF0, 0xFFFF, SvxResId(RID_SUBSETSTR_SPECIALS) );
1142  break;
1143  case UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS:
1144  aAllSubsets.emplace_back( 0xFF00, 0xFFEF, SvxResId(RID_SUBSETSTR_HALFW_FULLW_FORMS) );
1145  break;
1146  case UBLOCK_OLD_ITALIC:
1147  aAllSubsets.emplace_back( 0x10300, 0x1032F, SvxResId(RID_SUBSETSTR_OLD_ITALIC) );
1148  break;
1149  case UBLOCK_GOTHIC:
1150  aAllSubsets.emplace_back( 0x10330, 0x1034F, SvxResId(RID_SUBSETSTR_GOTHIC) );
1151  break;
1152  case UBLOCK_DESERET:
1153  aAllSubsets.emplace_back( 0x10400, 0x1044F, SvxResId(RID_SUBSETSTR_DESERET) );
1154  break;
1155  case UBLOCK_BYZANTINE_MUSICAL_SYMBOLS:
1156  aAllSubsets.emplace_back( 0x1D000, 0x1D0FF, SvxResId(RID_SUBSETSTR_BYZANTINE_MUSICAL_SYMBOLS) );
1157  break;
1158  case UBLOCK_MUSICAL_SYMBOLS:
1159  aAllSubsets.emplace_back( 0x1D100, 0x1D1FF, SvxResId(RID_SUBSETSTR_MUSICAL_SYMBOLS) );
1160  break;
1161  case UBLOCK_MATHEMATICAL_ALPHANUMERIC_SYMBOLS:
1162  aAllSubsets.emplace_back( 0x1D400, 0x1D7FF, SvxResId(RID_SUBSETSTR_MATHEMATICAL_ALPHANUMERIC_SYMBOLS) );
1163  break;
1164  case UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B:
1165  aAllSubsets.emplace_back( 0x20000, 0x2A6DF, SvxResId(RID_SUBSETSTR_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B) );
1166  break;
1167  case UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT:
1168  aAllSubsets.emplace_back( 0x2F800, 0x2FA1F, SvxResId(RID_SUBSETSTR_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT) );
1169  break;
1170  case UBLOCK_TAGS:
1171  aAllSubsets.emplace_back( 0xE0000, 0xE007F, SvxResId(RID_SUBSETSTR_TAGS) );
1172  break;
1173  case UBLOCK_CYRILLIC_SUPPLEMENTARY:
1174  aAllSubsets.emplace_back( 0x0500, 0x052F, SvxResId(RID_SUBSETSTR_CYRILLIC_SUPPLEMENTARY) );
1175  break;
1176  case UBLOCK_TAGALOG:
1177  aAllSubsets.emplace_back( 0x1700, 0x171F, SvxResId(RID_SUBSETSTR_TAGALOG) );
1178  break;
1179  case UBLOCK_HANUNOO:
1180  aAllSubsets.emplace_back( 0x1720, 0x173F, SvxResId(RID_SUBSETSTR_HANUNOO) );
1181  break;
1182  case UBLOCK_BUHID:
1183  aAllSubsets.emplace_back( 0x1740, 0x175F, SvxResId(RID_SUBSETSTR_BUHID) );
1184  break;
1185  case UBLOCK_TAGBANWA:
1186  aAllSubsets.emplace_back( 0x1760, 0x177F, SvxResId(RID_SUBSETSTR_TAGBANWA) );
1187  break;
1188  case UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A:
1189  aAllSubsets.emplace_back( 0x27C0, 0x27EF, SvxResId(RID_SUBSETSTR_MISC_MATH_SYMS_A) );
1190  break;
1191  case UBLOCK_SUPPLEMENTAL_ARROWS_A:
1192  aAllSubsets.emplace_back( 0x27F0, 0x27FF, SvxResId(RID_SUBSETSTR_SUPPL_ARROWS_A) );
1193  break;
1194  case UBLOCK_SUPPLEMENTAL_ARROWS_B:
1195  aAllSubsets.emplace_back( 0x2900, 0x297F, SvxResId(RID_SUBSETSTR_SUPPL_ARROWS_B) );
1196  break;
1197  case UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B:
1198  aAllSubsets.emplace_back( 0x2980, 0x29FF, SvxResId(RID_SUBSETSTR_MISC_MATH_SYMS_B) );
1199  break;
1200  case UBLOCK_SUPPLEMENTAL_MATHEMATICAL_OPERATORS:
1201  aAllSubsets.emplace_back( 0x2A00, 0x2AFF, SvxResId(RID_SUBSETSTR_MISC_MATH_SYMS_B) );
1202  break;
1203  case UBLOCK_KATAKANA_PHONETIC_EXTENSIONS:
1204  aAllSubsets.emplace_back( 0x31F0, 0x31FF, SvxResId(RID_SUBSETSTR_KATAKANA_PHONETIC) );
1205  break;
1206  case UBLOCK_VARIATION_SELECTORS:
1207  aAllSubsets.emplace_back( 0xFE00, 0xFE0F, SvxResId(RID_SUBSETSTR_VARIATION_SELECTORS) );
1208  break;
1209  case UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_A:
1210  aAllSubsets.emplace_back( 0xF0000, 0xFFFFF, SvxResId(RID_SUBSETSTR_SUPPLEMENTARY_PRIVATE_USE_AREA_A) );
1211  break;
1212  case UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_B:
1213  aAllSubsets.emplace_back( 0x100000, 0x10FFFF, SvxResId(RID_SUBSETSTR_SUPPLEMENTARY_PRIVATE_USE_AREA_B) );
1214  break;
1215  case UBLOCK_LIMBU:
1216  aAllSubsets.emplace_back( 0x1900, 0x194F, SvxResId(RID_SUBSETSTR_LIMBU) );
1217  break;
1218  case UBLOCK_TAI_LE:
1219  aAllSubsets.emplace_back( 0x1950, 0x197F, SvxResId(RID_SUBSETSTR_TAI_LE) );
1220  break;
1221  case UBLOCK_KHMER_SYMBOLS:
1222  aAllSubsets.emplace_back( 0x19E0, 0x19FF, SvxResId(RID_SUBSETSTR_KHMER_SYMBOLS) );
1223  break;
1224  case UBLOCK_PHONETIC_EXTENSIONS:
1225  aAllSubsets.emplace_back( 0x1D00, 0x1D7F, SvxResId(RID_SUBSETSTR_PHONETIC_EXTENSIONS) );
1226  break;
1227  case UBLOCK_MISCELLANEOUS_SYMBOLS_AND_ARROWS:
1228  aAllSubsets.emplace_back( 0x2B00, 0x2BFF, SvxResId(RID_SUBSETSTR_MISCELLANEOUS_SYMBOLS_AND_ARROWS) );
1229  break;
1230  case UBLOCK_YIJING_HEXAGRAM_SYMBOLS:
1231  aAllSubsets.emplace_back( 0x4DC0, 0x4DFF, SvxResId(RID_SUBSETSTR_YIJING_HEXAGRAM_SYMBOLS) );
1232  break;
1233  case UBLOCK_LINEAR_B_SYLLABARY:
1234  aAllSubsets.emplace_back( 0x10000, 0x1007F, SvxResId(RID_SUBSETSTR_LINEAR_B_SYLLABARY) );
1235  break;
1236  case UBLOCK_LINEAR_B_IDEOGRAMS:
1237  aAllSubsets.emplace_back( 0x10080, 0x100FF, SvxResId(RID_SUBSETSTR_LINEAR_B_IDEOGRAMS) );
1238  break;
1239  case UBLOCK_AEGEAN_NUMBERS:
1240  aAllSubsets.emplace_back( 0x10100, 0x1013F, SvxResId(RID_SUBSETSTR_AEGEAN_NUMBERS) );
1241  break;
1242  case UBLOCK_UGARITIC:
1243  aAllSubsets.emplace_back( 0x10380, 0x1039F, SvxResId(RID_SUBSETSTR_UGARITIC) );
1244  break;
1245  case UBLOCK_SHAVIAN:
1246  aAllSubsets.emplace_back( 0x10450, 0x1047F, SvxResId(RID_SUBSETSTR_SHAVIAN) );
1247  break;
1248  case UBLOCK_OSMANYA:
1249  aAllSubsets.emplace_back( 0x10480, 0x104AF, SvxResId(RID_SUBSETSTR_OSMANYA) );
1250  break;
1251  case UBLOCK_CYPRIOT_SYLLABARY:
1252  aAllSubsets.emplace_back( 0x10800, 0x1083F, SvxResId(RID_SUBSETSTR_CYPRIOT_SYLLABARY) );
1253  break;
1254  case UBLOCK_TAI_XUAN_JING_SYMBOLS:
1255  aAllSubsets.emplace_back( 0x1D300, 0x1D35F, SvxResId(RID_SUBSETSTR_TAI_XUAN_JING_SYMBOLS) );
1256  break;
1257  case UBLOCK_VARIATION_SELECTORS_SUPPLEMENT:
1258  aAllSubsets.emplace_back( 0xE0100, 0xE01EF, SvxResId(RID_SUBSETSTR_VARIATION_SELECTORS_SUPPLEMENT) );
1259  break;
1260  case UBLOCK_ANCIENT_GREEK_MUSICAL_NOTATION:
1261  aAllSubsets.emplace_back(0x1D200, 0x1D24F, SvxResId(RID_SUBSETSTR_ANCIENT_GREEK_MUSICAL_NOTATION) );
1262  break;
1263  case UBLOCK_ANCIENT_GREEK_NUMBERS:
1264  aAllSubsets.emplace_back(0x10140, 0x1018F , SvxResId(RID_SUBSETSTR_ANCIENT_GREEK_NUMBERS) );
1265  break;
1266  case UBLOCK_ARABIC_SUPPLEMENT:
1267  aAllSubsets.emplace_back(0x0750, 0x077F , SvxResId(RID_SUBSETSTR_ARABIC_SUPPLEMENT) );
1268  break;
1269  case UBLOCK_BUGINESE:
1270  aAllSubsets.emplace_back(0x1A00, 0x1A1F , SvxResId(RID_SUBSETSTR_BUGINESE) );
1271  break;
1272  case UBLOCK_CJK_STROKES:
1273  aAllSubsets.emplace_back( 0x31C0, 0x31EF, SvxResId(RID_SUBSETSTR_CJK_STROKES) );
1274  break;
1275  case UBLOCK_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT:
1276  aAllSubsets.emplace_back( 0x1DC0, 0x1DFF , SvxResId(RID_SUBSETSTR_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT) );
1277  break;
1278  case UBLOCK_COPTIC:
1279  aAllSubsets.emplace_back( 0x2C80, 0x2CFF , SvxResId(RID_SUBSETSTR_COPTIC) );
1280  break;
1281  case UBLOCK_ETHIOPIC_EXTENDED:
1282  aAllSubsets.emplace_back( 0x2D80, 0x2DDF , SvxResId(RID_SUBSETSTR_ETHIOPIC_EXTENDED) );
1283  break;
1284  case UBLOCK_ETHIOPIC_SUPPLEMENT:
1285  aAllSubsets.emplace_back( 0x1380, 0x139F, SvxResId(RID_SUBSETSTR_ETHIOPIC_SUPPLEMENT) );
1286  break;
1287  case UBLOCK_GEORGIAN_SUPPLEMENT:
1288  aAllSubsets.emplace_back( 0x2D00, 0x2D2F, SvxResId(RID_SUBSETSTR_GEORGIAN_SUPPLEMENT) );
1289  break;
1290  case UBLOCK_GLAGOLITIC:
1291  aAllSubsets.emplace_back( 0x2C00, 0x2C5F, SvxResId(RID_SUBSETSTR_GLAGOLITIC) );
1292  break;
1293  case UBLOCK_KHAROSHTHI:
1294  aAllSubsets.emplace_back( 0x10A00, 0x10A5F, SvxResId(RID_SUBSETSTR_KHAROSHTHI) );
1295  break;
1296  case UBLOCK_MODIFIER_TONE_LETTERS:
1297  aAllSubsets.emplace_back( 0xA700, 0xA71F, SvxResId(RID_SUBSETSTR_MODIFIER_TONE_LETTERS) );
1298  break;
1299  case UBLOCK_NEW_TAI_LUE:
1300  aAllSubsets.emplace_back( 0x1980, 0x19DF, SvxResId(RID_SUBSETSTR_NEW_TAI_LUE) );
1301  break;
1302  case UBLOCK_OLD_PERSIAN:
1303  aAllSubsets.emplace_back( 0x103A0, 0x103DF, SvxResId(RID_SUBSETSTR_OLD_PERSIAN) );
1304  break;
1305  case UBLOCK_PHONETIC_EXTENSIONS_SUPPLEMENT:
1306  aAllSubsets.emplace_back( 0x1D80, 0x1DBF, SvxResId(RID_SUBSETSTR_PHONETIC_EXTENSIONS_SUPPLEMENT) );
1307  break;
1308  case UBLOCK_SUPPLEMENTAL_PUNCTUATION:
1309  aAllSubsets.emplace_back( 0x2E00, 0x2E7F, SvxResId(RID_SUBSETSTR_SUPPLEMENTAL_PUNCTUATION) );
1310  break;
1311  case UBLOCK_SYLOTI_NAGRI:
1312  aAllSubsets.emplace_back( 0xA800, 0xA82F, SvxResId(RID_SUBSETSTR_SYLOTI_NAGRI) );
1313  break;
1314  case UBLOCK_TIFINAGH:
1315  aAllSubsets.emplace_back( 0x2D30, 0x2D7F, SvxResId(RID_SUBSETSTR_TIFINAGH) );
1316  break;
1317  case UBLOCK_VERTICAL_FORMS:
1318  aAllSubsets.emplace_back( 0xFE10, 0xFE1F, SvxResId(RID_SUBSETSTR_VERTICAL_FORMS) );
1319  break;
1320  case UBLOCK_NKO:
1321  aAllSubsets.emplace_back( 0x07C0, 0x07FF, SvxResId(RID_SUBSETSTR_NKO) );
1322  break;
1323  case UBLOCK_BALINESE:
1324  aAllSubsets.emplace_back( 0x1B00, 0x1B7F, SvxResId(RID_SUBSETSTR_BALINESE) );
1325  break;
1326  case UBLOCK_LATIN_EXTENDED_C:
1327  aAllSubsets.emplace_back( 0x2C60, 0x2C7F, SvxResId(RID_SUBSETSTR_LATIN_EXTENDED_C) );
1328  break;
1329  case UBLOCK_LATIN_EXTENDED_D:
1330  aAllSubsets.emplace_back( 0xA720, 0xA7FF, SvxResId(RID_SUBSETSTR_LATIN_EXTENDED_D) );
1331  break;
1332  case UBLOCK_PHAGS_PA:
1333  aAllSubsets.emplace_back( 0xA840, 0xA87F, SvxResId(RID_SUBSETSTR_PHAGS_PA) );
1334  break;
1335  case UBLOCK_PHOENICIAN:
1336  aAllSubsets.emplace_back( 0x10900, 0x1091F, SvxResId(RID_SUBSETSTR_PHOENICIAN) );
1337  break;
1338  case UBLOCK_CUNEIFORM:
1339  aAllSubsets.emplace_back( 0x12000, 0x123FF, SvxResId(RID_SUBSETSTR_CUNEIFORM) );
1340  break;
1341  case UBLOCK_CUNEIFORM_NUMBERS_AND_PUNCTUATION:
1342  aAllSubsets.emplace_back( 0x12400, 0x1247F, SvxResId(RID_SUBSETSTR_CUNEIFORM_NUMBERS_AND_PUNCTUATION) );
1343  break;
1344  case UBLOCK_COUNTING_ROD_NUMERALS:
1345  aAllSubsets.emplace_back( 0x1D360, 0x1D37F, SvxResId(RID_SUBSETSTR_COUNTING_ROD_NUMERALS) );
1346  break;
1347  case UBLOCK_SUNDANESE:
1348  aAllSubsets.emplace_back( 0x1B80, 0x1BBF, SvxResId(RID_SUBSETSTR_SUNDANESE) );
1349  break;
1350  case UBLOCK_LEPCHA:
1351  aAllSubsets.emplace_back( 0x1C00, 0x1C4F, SvxResId(RID_SUBSETSTR_LEPCHA) );
1352  break;
1353  case UBLOCK_OL_CHIKI:
1354  aAllSubsets.emplace_back( 0x1C50, 0x1C7F, SvxResId(RID_SUBSETSTR_OL_CHIKI) );
1355  break;
1356  case UBLOCK_CYRILLIC_EXTENDED_A:
1357  aAllSubsets.emplace_back( 0x2DE0, 0x2DFF, SvxResId(RID_SUBSETSTR_CYRILLIC_EXTENDED_A) );
1358  break;
1359  case UBLOCK_VAI:
1360  aAllSubsets.emplace_back( 0xA500, 0xA63F, SvxResId(RID_SUBSETSTR_VAI) );
1361  break;
1362  case UBLOCK_CYRILLIC_EXTENDED_B:
1363  aAllSubsets.emplace_back( 0xA640, 0xA69F, SvxResId(RID_SUBSETSTR_CYRILLIC_EXTENDED_B) );
1364  break;
1365  case UBLOCK_SAURASHTRA:
1366  aAllSubsets.emplace_back( 0xA880, 0xA8DF, SvxResId(RID_SUBSETSTR_SAURASHTRA) );
1367  break;
1368  case UBLOCK_KAYAH_LI:
1369  aAllSubsets.emplace_back( 0xA900, 0xA92F, SvxResId(RID_SUBSETSTR_KAYAH_LI) );
1370  break;
1371  case UBLOCK_REJANG:
1372  aAllSubsets.emplace_back( 0xA930, 0xA95F, SvxResId(RID_SUBSETSTR_REJANG) );
1373  break;
1374  case UBLOCK_CHAM:
1375  aAllSubsets.emplace_back( 0xAA00, 0xAA5F, SvxResId(RID_SUBSETSTR_CHAM) );
1376  break;
1377  case UBLOCK_ANCIENT_SYMBOLS:
1378  aAllSubsets.emplace_back( 0x10190, 0x101CF, SvxResId(RID_SUBSETSTR_ANCIENT_SYMBOLS) );
1379  break;
1380  case UBLOCK_PHAISTOS_DISC:
1381  aAllSubsets.emplace_back( 0x101D0, 0x101FF, SvxResId(RID_SUBSETSTR_PHAISTOS_DISC) );
1382  break;
1383  case UBLOCK_LYCIAN:
1384  aAllSubsets.emplace_back( 0x10280, 0x1029F, SvxResId(RID_SUBSETSTR_LYCIAN) );
1385  break;
1386  case UBLOCK_CARIAN:
1387  aAllSubsets.emplace_back( 0x102A0, 0x102DF, SvxResId(RID_SUBSETSTR_CARIAN) );
1388  break;
1389  case UBLOCK_LYDIAN:
1390  aAllSubsets.emplace_back( 0x10920, 0x1093F, SvxResId(RID_SUBSETSTR_LYDIAN) );
1391  break;
1392  case UBLOCK_MAHJONG_TILES:
1393  aAllSubsets.emplace_back( 0x1F000, 0x1F02F, SvxResId(RID_SUBSETSTR_MAHJONG_TILES) );
1394  break;
1395  case UBLOCK_DOMINO_TILES:
1396  aAllSubsets.emplace_back( 0x1F030, 0x1F09F, SvxResId(RID_SUBSETSTR_DOMINO_TILES) );
1397  break;
1398 #if (U_ICU_VERSION_MAJOR_NUM > 4) || (U_ICU_VERSION_MAJOR_NUM == 4 && U_ICU_VERSION_MINOR_NUM >= 4)
1399  case UBLOCK_SAMARITAN:
1400  aAllSubsets.emplace_back( 0x0800, 0x083F, SvxResId(RID_SUBSETSTR_SAMARITAN) );
1401  break;
1402  case UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED:
1403  aAllSubsets.emplace_back( 0x18B0, 0x18FF, SvxResId(RID_SUBSETSTR_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED) );
1404  break;
1405  case UBLOCK_TAI_THAM:
1406  aAllSubsets.emplace_back( 0x1A20, 0x1AAF, SvxResId(RID_SUBSETSTR_TAI_THAM) );
1407  break;
1408  case UBLOCK_VEDIC_EXTENSIONS:
1409  aAllSubsets.emplace_back( 0x1CD0, 0x1CFF, SvxResId(RID_SUBSETSTR_VEDIC_EXTENSIONS) );
1410  break;
1411  case UBLOCK_LISU:
1412  aAllSubsets.emplace_back( 0xA4D0, 0xA4FF, SvxResId(RID_SUBSETSTR_LISU) );
1413  break;
1414  case UBLOCK_BAMUM:
1415  aAllSubsets.emplace_back( 0xA6A0, 0xA6FF, SvxResId(RID_SUBSETSTR_BAMUM) );
1416  break;
1417  case UBLOCK_COMMON_INDIC_NUMBER_FORMS:
1418  aAllSubsets.emplace_back( 0xA830, 0xA83F, SvxResId(RID_SUBSETSTR_COMMON_INDIC_NUMBER_FORMS) );
1419  break;
1420  case UBLOCK_DEVANAGARI_EXTENDED:
1421  aAllSubsets.emplace_back( 0xA8E0, 0xA8FF, SvxResId(RID_SUBSETSTR_DEVANAGARI_EXTENDED) );
1422  break;
1423  case UBLOCK_HANGUL_JAMO_EXTENDED_A:
1424  aAllSubsets.emplace_back( 0xA960, 0xA97F, SvxResId(RID_SUBSETSTR_HANGUL_JAMO_EXTENDED_A) );
1425  break;
1426  case UBLOCK_JAVANESE:
1427  aAllSubsets.emplace_back( 0xA980, 0xA9DF, SvxResId(RID_SUBSETSTR_JAVANESE) );
1428  break;
1429  case UBLOCK_MYANMAR_EXTENDED_A:
1430  aAllSubsets.emplace_back( 0xAA60, 0xAA7F, SvxResId(RID_SUBSETSTR_MYANMAR_EXTENDED_A) );
1431  break;
1432  case UBLOCK_TAI_VIET:
1433  aAllSubsets.emplace_back( 0xAA80, 0xAADF, SvxResId(RID_SUBSETSTR_TAI_VIET) );
1434  break;
1435  case UBLOCK_MEETEI_MAYEK:
1436  aAllSubsets.emplace_back( 0xABC0, 0xABFF, SvxResId(RID_SUBSETSTR_MEETEI_MAYEK) );
1437  break;
1438  case UBLOCK_HANGUL_JAMO_EXTENDED_B:
1439  aAllSubsets.emplace_back( 0xD7B0, 0xD7FF, SvxResId(RID_SUBSETSTR_HANGUL_JAMO_EXTENDED_B) );
1440  break;
1441  case UBLOCK_IMPERIAL_ARAMAIC:
1442  aAllSubsets.emplace_back( 0x10840, 0x1085F, SvxResId(RID_SUBSETSTR_IMPERIAL_ARAMAIC) );
1443  break;
1444  case UBLOCK_OLD_SOUTH_ARABIAN:
1445  aAllSubsets.emplace_back( 0x10A60, 0x10A7F, SvxResId(RID_SUBSETSTR_OLD_SOUTH_ARABIAN) );
1446  break;
1447  case UBLOCK_AVESTAN:
1448  aAllSubsets.emplace_back( 0x10B00, 0x10B3F, SvxResId(RID_SUBSETSTR_AVESTAN) );
1449  break;
1450  case UBLOCK_INSCRIPTIONAL_PARTHIAN:
1451  aAllSubsets.emplace_back( 0x10B40, 0x10B5F, SvxResId(RID_SUBSETSTR_INSCRIPTIONAL_PARTHIAN) );
1452  break;
1453  case UBLOCK_INSCRIPTIONAL_PAHLAVI:
1454  aAllSubsets.emplace_back( 0x10B60, 0x10B7F, SvxResId(RID_SUBSETSTR_INSCRIPTIONAL_PAHLAVI) );
1455  break;
1456  case UBLOCK_OLD_TURKIC:
1457  aAllSubsets.emplace_back( 0x10C00, 0x10C4F, SvxResId(RID_SUBSETSTR_OLD_TURKIC) );
1458  break;
1459  case UBLOCK_RUMI_NUMERAL_SYMBOLS:
1460  aAllSubsets.emplace_back( 0x10E60, 0x10E7F, SvxResId(RID_SUBSETSTR_RUMI_NUMERAL_SYMBOLS) );
1461  break;
1462  case UBLOCK_KAITHI:
1463  aAllSubsets.emplace_back( 0x11080, 0x110CF, SvxResId(RID_SUBSETSTR_KAITHI) );
1464  break;
1465  case UBLOCK_EGYPTIAN_HIEROGLYPHS:
1466  aAllSubsets.emplace_back( 0x13000, 0x1342F, SvxResId(RID_SUBSETSTR_EGYPTIAN_HIEROGLYPHS) );
1467  break;
1468  case UBLOCK_ENCLOSED_ALPHANUMERIC_SUPPLEMENT:
1469  aAllSubsets.emplace_back( 0x1F100, 0x1F1FF, SvxResId(RID_SUBSETSTR_ENCLOSED_ALPHANUMERIC_SUPPLEMENT) );
1470  break;
1471  case UBLOCK_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT:
1472  aAllSubsets.emplace_back( 0x1F200, 0x1F2FF, SvxResId(RID_SUBSETSTR_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT) );
1473  break;
1474  case UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C:
1475  aAllSubsets.emplace_back( 0x2A700, 0x2B73F, SvxResId(RID_SUBSETSTR_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C) );
1476  break;
1477 #endif
1478 #if (U_ICU_VERSION_MAJOR_NUM > 4) || (U_ICU_VERSION_MAJOR_NUM == 4 && U_ICU_VERSION_MINOR_NUM >= 6)
1479  case UBLOCK_MANDAIC:
1480  aAllSubsets.emplace_back( 0x0840, 0x085F, SvxResId(RID_SUBSETSTR_MANDAIC) );
1481  break;
1482  case UBLOCK_BATAK:
1483  aAllSubsets.emplace_back( 0x1BC0, 0x1BFF, SvxResId(RID_SUBSETSTR_BATAK) );
1484  break;
1485  case UBLOCK_ETHIOPIC_EXTENDED_A:
1486  aAllSubsets.emplace_back( 0xAB00, 0xAB2F, SvxResId(RID_SUBSETSTR_ETHIOPIC_EXTENDED_A) );
1487  break;
1488  case UBLOCK_BRAHMI:
1489  aAllSubsets.emplace_back( 0x11000, 0x1107F, SvxResId(RID_SUBSETSTR_BRAHMI) );
1490  break;
1491  case UBLOCK_BAMUM_SUPPLEMENT:
1492  aAllSubsets.emplace_back( 0x16800, 0x16A3F, SvxResId(RID_SUBSETSTR_BAMUM_SUPPLEMENT) );
1493  break;
1494  case UBLOCK_KANA_SUPPLEMENT:
1495  aAllSubsets.emplace_back( 0x1B000, 0x1B0FF, SvxResId(RID_SUBSETSTR_KANA_SUPPLEMENT) );
1496  break;
1497  case UBLOCK_PLAYING_CARDS:
1498  aAllSubsets.emplace_back( 0x1F0A0, 0x1F0FF, SvxResId(RID_SUBSETSTR_PLAYING_CARDS) );
1499  break;
1500  case UBLOCK_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS:
1501  aAllSubsets.emplace_back( 0x1F300, 0x1F5FF, SvxResId(RID_SUBSETSTR_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS) );
1502  break;
1503  case UBLOCK_EMOTICONS:
1504  aAllSubsets.emplace_back( 0x1F600, 0x1F64F, SvxResId(RID_SUBSETSTR_EMOTICONS) );
1505  break;
1506  case UBLOCK_TRANSPORT_AND_MAP_SYMBOLS:
1507  aAllSubsets.emplace_back( 0x1F680, 0x1F6FF, SvxResId(RID_SUBSETSTR_TRANSPORT_AND_MAP_SYMBOLS) );
1508  break;
1509  case UBLOCK_ALCHEMICAL_SYMBOLS:
1510  aAllSubsets.emplace_back( 0x1F700, 0x1F77F, SvxResId(RID_SUBSETSTR_ALCHEMICAL_SYMBOLS) );
1511  break;
1512  case UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D:
1513  aAllSubsets.emplace_back( 0x2B740, 0x2B81F, SvxResId(RID_SUBSETSTR_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D) );
1514  break;
1515 #endif
1516 // Note ICU version 49 (NOT 4.9), so the MAJOR_NUM is two digits.
1517 #if U_ICU_VERSION_MAJOR_NUM >= 49
1518  case UBLOCK_ARABIC_EXTENDED_A:
1519  aAllSubsets.emplace_back( 0x08A0, 0x08FF, SvxResId(RID_SUBSETSTR_ARABIC_EXTENDED_A) );
1520  break;
1521  case UBLOCK_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS:
1522  aAllSubsets.emplace_back( 0x1EE00, 0x1EEFF, SvxResId(RID_SUBSETSTR_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS) );
1523  break;
1524  case UBLOCK_CHAKMA:
1525  aAllSubsets.emplace_back( 0x11100, 0x1114F, SvxResId(RID_SUBSETSTR_CHAKMA) );
1526  break;
1527  case UBLOCK_MEETEI_MAYEK_EXTENSIONS:
1528  aAllSubsets.emplace_back( 0xAAE0, 0xAAFF, SvxResId(RID_SUBSETSTR_MEETEI_MAYEK_EXTENSIONS) );
1529  break;
1530  case UBLOCK_MEROITIC_CURSIVE:
1531  aAllSubsets.emplace_back( 0x109A0, 0x109FF, SvxResId(RID_SUBSETSTR_MEROITIC_CURSIVE) );
1532  break;
1533  case UBLOCK_MEROITIC_HIEROGLYPHS:
1534  aAllSubsets.emplace_back( 0x10980, 0x1099F, SvxResId(RID_SUBSETSTR_MEROITIC_HIEROGLYPHS) );
1535  break;
1536  case UBLOCK_MIAO:
1537  aAllSubsets.emplace_back( 0x16F00, 0x16F9F, SvxResId(RID_SUBSETSTR_MIAO) );
1538  break;
1539  case UBLOCK_SHARADA:
1540  aAllSubsets.emplace_back( 0x11180, 0x111DF, SvxResId(RID_SUBSETSTR_SHARADA) );
1541  break;
1542  case UBLOCK_SORA_SOMPENG:
1543  aAllSubsets.emplace_back( 0x110D0, 0x110FF, SvxResId(RID_SUBSETSTR_SORA_SOMPENG) );
1544  break;
1545  case UBLOCK_SUNDANESE_SUPPLEMENT:
1546  aAllSubsets.emplace_back( 0x1CC0, 0x1CCF, SvxResId(RID_SUBSETSTR_SUNDANESE_SUPPLEMENT) );
1547  break;
1548  case UBLOCK_TAKRI:
1549  aAllSubsets.emplace_back( 0x11680, 0x116CF, SvxResId(RID_SUBSETSTR_TAKRI) );
1550  break;
1551 #endif
1552 #if U_ICU_VERSION_MAJOR_NUM >= 54
1553  case UBLOCK_BASSA_VAH:
1554  aAllSubsets.emplace_back( 0x16AD0, 0x16AFF, SvxResId(RID_SUBSETSTR_BASSA_VAH) );
1555  break;
1556  case UBLOCK_CAUCASIAN_ALBANIAN:
1557  aAllSubsets.emplace_back( 0x10530, 0x1056F, SvxResId(RID_SUBSETSTR_CAUCASIAN_ALBANIAN) );
1558  break;
1559  case UBLOCK_COPTIC_EPACT_NUMBERS:
1560  aAllSubsets.emplace_back( 0x102E0, 0x102FF, SvxResId(RID_SUBSETSTR_COPTIC_EPACT_NUMBERS) );
1561  break;
1562  case UBLOCK_COMBINING_DIACRITICAL_MARKS_EXTENDED:
1563  aAllSubsets.emplace_back( 0x1AB0, 0x1AFF, SvxResId(RID_SUBSETSTR_COMBINING_DIACRITICAL_MARKS_EXTENDED) );
1564  break;
1565  case UBLOCK_DUPLOYAN:
1566  aAllSubsets.emplace_back( 0x1BC00, 0x1BC9F, SvxResId(RID_SUBSETSTR_DUPLOYAN) );
1567  break;
1568  case UBLOCK_ELBASAN:
1569  aAllSubsets.emplace_back( 0x10500, 0x1052F, SvxResId(RID_SUBSETSTR_ELBASAN) );
1570  break;
1571  case UBLOCK_GEOMETRIC_SHAPES_EXTENDED:
1572  aAllSubsets.emplace_back( 0x1F780, 0x1F7FF, SvxResId(RID_SUBSETSTR_GEOMETRIC_SHAPES_EXTENDED) );
1573  break;
1574  case UBLOCK_GRANTHA:
1575  aAllSubsets.emplace_back( 0x11300, 0x1137F, SvxResId(RID_SUBSETSTR_GRANTHA) );
1576  break;
1577  case UBLOCK_KHOJKI:
1578  aAllSubsets.emplace_back( 0x11200, 0x1124F, SvxResId(RID_SUBSETSTR_KHOJKI) );
1579  break;
1580  case UBLOCK_KHUDAWADI:
1581  aAllSubsets.emplace_back( 0x112B0, 0x112FF, SvxResId(RID_SUBSETSTR_KHUDAWADI) );
1582  break;
1583  case UBLOCK_LATIN_EXTENDED_E:
1584  aAllSubsets.emplace_back( 0xAB30, 0xAB6F, SvxResId(RID_SUBSETSTR_LATIN_EXTENDED_E) );
1585  break;
1586  case UBLOCK_LINEAR_A:
1587  aAllSubsets.emplace_back( 0x10600, 0x1077F, SvxResId(RID_SUBSETSTR_LINEAR_A) );
1588  break;
1589  case UBLOCK_MAHAJANI:
1590  aAllSubsets.emplace_back( 0x11150, 0x1117F, SvxResId(RID_SUBSETSTR_MAHAJANI) );
1591  break;
1592  case UBLOCK_MANICHAEAN:
1593  aAllSubsets.emplace_back( 0x10AC0, 0x10AFF, SvxResId(RID_SUBSETSTR_MANICHAEAN) );
1594  break;
1595  case UBLOCK_MENDE_KIKAKUI:
1596  aAllSubsets.emplace_back( 0x1E800, 0x1E8DF, SvxResId(RID_SUBSETSTR_MENDE_KIKAKUI) );
1597  break;
1598  case UBLOCK_MODI:
1599  aAllSubsets.emplace_back( 0x11600, 0x1165F, SvxResId(RID_SUBSETSTR_MODI) );
1600  break;
1601  case UBLOCK_MRO:
1602  aAllSubsets.emplace_back( 0x16A40, 0x16A6F, SvxResId(RID_SUBSETSTR_MRO) );
1603  break;
1604  case UBLOCK_MYANMAR_EXTENDED_B:
1605  aAllSubsets.emplace_back( 0xA9E0, 0xA9FF, SvxResId(RID_SUBSETSTR_MYANMAR_EXTENDED_B) );
1606  break;
1607  case UBLOCK_NABATAEAN:
1608  aAllSubsets.emplace_back( 0x10880, 0x108AF, SvxResId(RID_SUBSETSTR_NABATAEAN) );
1609  break;
1610  case UBLOCK_OLD_NORTH_ARABIAN:
1611  aAllSubsets.emplace_back( 0x10A80, 0x10A9F, SvxResId(RID_SUBSETSTR_OLD_NORTH_ARABIAN) );
1612  break;
1613  case UBLOCK_OLD_PERMIC:
1614  aAllSubsets.emplace_back( 0x10350, 0x1037F, SvxResId(RID_SUBSETSTR_OLD_PERMIC) );
1615  break;
1616  case UBLOCK_ORNAMENTAL_DINGBATS:
1617  aAllSubsets.emplace_back( 0x1F650, 0x1F67F, SvxResId(RID_SUBSETSTR_ORNAMENTAL_DINGBATS) );
1618  break;
1619  case UBLOCK_PAHAWH_HMONG:
1620  aAllSubsets.emplace_back( 0x16B00, 0x16B8F, SvxResId(RID_SUBSETSTR_PAHAWH_HMONG) );
1621  break;
1622  case UBLOCK_PALMYRENE:
1623  aAllSubsets.emplace_back( 0x10860, 0x1087F, SvxResId(RID_SUBSETSTR_PALMYRENE) );
1624  break;
1625  case UBLOCK_PAU_CIN_HAU:
1626  aAllSubsets.emplace_back( 0x11AC0, 0x11AFF, SvxResId(RID_SUBSETSTR_PAU_CIN_HAU) );
1627  break;
1628  case UBLOCK_PSALTER_PAHLAVI:
1629  aAllSubsets.emplace_back( 0x10B80, 0x10BAF, SvxResId(RID_SUBSETSTR_PSALTER_PAHLAVI) );
1630  break;
1631  case UBLOCK_SHORTHAND_FORMAT_CONTROLS:
1632  aAllSubsets.emplace_back( 0x1BCA0, 0x1BCAF, SvxResId(RID_SUBSETSTR_SHORTHAND_FORMAT_CONTROLS) );
1633  break;
1634  case UBLOCK_SIDDHAM:
1635  aAllSubsets.emplace_back( 0x11580, 0x115FF, SvxResId(RID_SUBSETSTR_SIDDHAM) );
1636  break;
1637  case UBLOCK_SINHALA_ARCHAIC_NUMBERS:
1638  aAllSubsets.emplace_back( 0x111E0, 0x111FF, SvxResId(RID_SUBSETSTR_SINHALA_ARCHAIC_NUMBERS) );
1639  break;
1640  case UBLOCK_SUPPLEMENTAL_ARROWS_C:
1641  aAllSubsets.emplace_back( 0x1F800, 0x1F8FF, SvxResId(RID_SUBSETSTR_SUPPLEMENTAL_ARROWS_C) );
1642  break;
1643  case UBLOCK_TIRHUTA:
1644  aAllSubsets.emplace_back( 0x11480, 0x114DF, SvxResId(RID_SUBSETSTR_TIRHUTA) );
1645  break;
1646  case UBLOCK_WARANG_CITI:
1647  aAllSubsets.emplace_back( 0x118A0, 0x118FF, SvxResId(RID_SUBSETSTR_WARANG_CITI) );
1648  break;
1649 #endif
1650 #if U_ICU_VERSION_MAJOR_NUM >= 56
1651  case UBLOCK_AHOM:
1652  aAllSubsets.emplace_back( 0x11700, 0x1173F, SvxResId(RID_SUBSETSTR_AHOM) );
1653  break;
1654  case UBLOCK_ANATOLIAN_HIEROGLYPHS:
1655  aAllSubsets.emplace_back( 0x14400, 0x1467F, SvxResId(RID_SUBSETSTR_ANATOLIAN_HIEROGLYPHS) );
1656  break;
1657  case UBLOCK_CHEROKEE_SUPPLEMENT:
1658  aAllSubsets.emplace_back( 0xAB70, 0xABBF, SvxResId(RID_SUBSETSTR_CHEROKEE_SUPPLEMENT) );
1659  break;
1660  case UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E:
1661  aAllSubsets.emplace_back( 0x2B820, 0x2CEAF, SvxResId(RID_SUBSETSTR_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E) );
1662  break;
1663  case UBLOCK_EARLY_DYNASTIC_CUNEIFORM:
1664  aAllSubsets.emplace_back( 0x12480, 0x1254F, SvxResId(RID_SUBSETSTR_EARLY_DYNASTIC_CUNEIFORM) );
1665  break;
1666  case UBLOCK_HATRAN:
1667  aAllSubsets.emplace_back( 0x108E0, 0x108FF, SvxResId(RID_SUBSETSTR_HATRAN) );
1668  break;
1669  case UBLOCK_MULTANI:
1670  aAllSubsets.emplace_back( 0x11280, 0x112AF, SvxResId(RID_SUBSETSTR_MULTANI) );
1671  break;
1672  case UBLOCK_OLD_HUNGARIAN:
1673  aAllSubsets.emplace_back( 0x10C80, 0x10CFF, SvxResId(RID_SUBSETSTR_OLD_HUNGARIAN) );
1674  break;
1675  case UBLOCK_SUPPLEMENTAL_SYMBOLS_AND_PICTOGRAPHS:
1676  aAllSubsets.emplace_back( 0x1F900, 0x1F9FF, SvxResId(RID_SUBSETSTR_SUPPLEMENTAL_SYMBOLS_AND_PICTOGRAPHS) );
1677  break;
1678  case UBLOCK_SUTTON_SIGNWRITING:
1679  aAllSubsets.emplace_back( 0x1D800, 0x1DAAF, SvxResId(RID_SUBSETSTR_SUTTON_SIGNWRITING) );
1680  break;
1681 #endif
1682 #if (U_ICU_VERSION_MAJOR_NUM >= 58)
1683  case UBLOCK_ADLAM:
1684  aAllSubsets.emplace_back( 0x1E900, 0x1E95F, SvxResId(RID_SUBSETSTR_ADLAM) );
1685  break;
1686  case UBLOCK_BHAIKSUKI:
1687  aAllSubsets.emplace_back( 0x11C00, 0x11C6F, SvxResId(RID_SUBSETSTR_BHAIKSUKI) );
1688  break;
1689  case UBLOCK_CYRILLIC_EXTENDED_C:
1690  aAllSubsets.emplace_back( 0x1C80, 0x1C8F, SvxResId(RID_SUBSETSTR_CYRILLIC_EXTENDED_C) );
1691  break;
1692  case UBLOCK_GLAGOLITIC_SUPPLEMENT:
1693  aAllSubsets.emplace_back( 0x1E000, 0x1E02F, SvxResId(RID_SUBSETSTR_GLAGOLITIC_SUPPLEMENT) );
1694  break;
1695  case UBLOCK_IDEOGRAPHIC_SYMBOLS_AND_PUNCTUATION:
1696  aAllSubsets.emplace_back( 0x16FE0, 0x16FFF, SvxResId(RID_SUBSETSTR_IDEOGRAPHIC_SYMBOLS_AND_PUNCTUATION) );
1697  break;
1698  case UBLOCK_MARCHEN:
1699  aAllSubsets.emplace_back( 0x11C70, 0x11CBF, SvxResId(RID_SUBSETSTR_MARCHEN) );
1700  break;
1701  case UBLOCK_MONGOLIAN_SUPPLEMENT:
1702  aAllSubsets.emplace_back( 0x11660, 0x1167F, SvxResId(RID_SUBSETSTR_MONGOLIAN_SUPPLEMENT) );
1703  break;
1704  case UBLOCK_NEWA:
1705  aAllSubsets.emplace_back( 0x11400, 0x1147F, SvxResId(RID_SUBSETSTR_NEWA) );
1706  break;
1707  case UBLOCK_OSAGE:
1708  aAllSubsets.emplace_back( 0x104B0, 0x104FF, SvxResId(RID_SUBSETSTR_OSAGE) );
1709  break;
1710  case UBLOCK_TANGUT:
1711  aAllSubsets.emplace_back( 0x17000, 0x187FF, SvxResId(RID_SUBSETSTR_TANGUT) );
1712  break;
1713  case UBLOCK_TANGUT_COMPONENTS:
1714  aAllSubsets.emplace_back( 0x18800, 0x18AFF, SvxResId(RID_SUBSETSTR_TANGUT_COMPONENTS) );
1715  break;
1716 #endif
1717 #if (U_ICU_VERSION_MAJOR_NUM >= 60)
1718  case UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_F:
1719  aAllSubsets.emplace_back( 0x2CEB0, 0x2EBE0, SvxResId(RID_SUBSETSTR_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_F) );
1720  break;
1721  case UBLOCK_KANA_EXTENDED_A:
1722  aAllSubsets.emplace_back( 0x1B100, 0x1B12F, SvxResId(RID_SUBSETSTR_KANA_EXTENDED_A) );
1723  break;
1724  case UBLOCK_MASARAM_GONDI:
1725  aAllSubsets.emplace_back( 0x11D00, 0x11D5F, SvxResId(RID_SUBSETSTR_MASARAM_GONDI) );
1726  break;
1727  case UBLOCK_NUSHU:
1728  aAllSubsets.emplace_back( 0x1B170, 0x1B2FF, SvxResId(RID_SUBSETSTR_NUSHU) );
1729  break;
1730  case UBLOCK_SOYOMBO:
1731  aAllSubsets.emplace_back( 0x11A50, 0x11AAF, SvxResId(RID_SUBSETSTR_SOYOMBO) );
1732  break;
1733  case UBLOCK_SYRIAC_SUPPLEMENT:
1734  aAllSubsets.emplace_back( 0x0860, 0x086f, SvxResId(RID_SUBSETSTR_SYRIAC_SUPPLEMENT) );
1735  break;
1736  case UBLOCK_ZANABAZAR_SQUARE:
1737  aAllSubsets.emplace_back( 0x11A00, 0x11A4F, SvxResId(RID_SUBSETSTR_ZANABAZAR_SQUARE) );
1738  break;
1739 #endif
1740 #if (U_ICU_VERSION_MAJOR_NUM >= 62)
1741  case UBLOCK_CHESS_SYMBOLS:
1742  aAllSubsets.emplace_back( 0x1FA00, 0x1FA6F, SvxResId(RID_SUBSETSTR_CHESS_SYMBOLS) );
1743  break;
1744  case UBLOCK_DOGRA:
1745  aAllSubsets.emplace_back( 0x11800, 0x1184F, SvxResId(RID_SUBSETSTR_DOGRA) );
1746  break;
1747  case UBLOCK_GEORGIAN_EXTENDED:
1748  aAllSubsets.emplace_back( 0x1C90, 0x1CBF, SvxResId(RID_SUBSETSTR_GEORGIAN_EXTENDED) );
1749  break;
1750  case UBLOCK_GUNJALA_GONDI:
1751  aAllSubsets.emplace_back( 0x11D60, 0x11DAF, SvxResId(RID_SUBSETSTR_GUNJALA_GONDI) );
1752  break;
1753  case UBLOCK_HANIFI_ROHINGYA:
1754  aAllSubsets.emplace_back( 0x10D00, 0x10D3F, SvxResId(RID_SUBSETSTR_HANIFI_ROHINGYA) );
1755  break;
1756  case UBLOCK_INDIC_SIYAQ_NUMBERS:
1757  aAllSubsets.emplace_back( 0x1EC70, 0x1ECBF, SvxResId(RID_SUBSETSTR_INDIC_SIYAQ_NUMBERS) );
1758  break;
1759  case UBLOCK_MAKASAR:
1760  aAllSubsets.emplace_back( 0x11EE0, 0x11EFF, SvxResId(RID_SUBSETSTR_MAKASAR) );
1761  break;
1762  case UBLOCK_MAYAN_NUMERALS:
1763  aAllSubsets.emplace_back( 0x1D2E0, 0x1D2FF, SvxResId(RID_SUBSETSTR_MAYAN_NUMERALS) );
1764  break;
1765  case UBLOCK_MEDEFAIDRIN:
1766  aAllSubsets.emplace_back( 0x16E40, 0x16E9F, SvxResId(RID_SUBSETSTR_MEDEFAIDRIN) );
1767  break;
1768  case UBLOCK_OLD_SOGDIAN:
1769  aAllSubsets.emplace_back( 0x10F00, 0x10F2F, SvxResId(RID_SUBSETSTR_OLD_SOGDIAN) );
1770  break;
1771  case UBLOCK_SOGDIAN:
1772  aAllSubsets.emplace_back( 0x10F30, 0x10F6F, SvxResId(RID_SUBSETSTR_SOGDIAN) );
1773  break;
1774 #endif
1775 #if (U_ICU_VERSION_MAJOR_NUM >= 64)
1776  case UBLOCK_EGYPTIAN_HIEROGLYPH_FORMAT_CONTROLS:
1777  aAllSubsets.emplace_back( 0x13430, 0x1343F, SvxResId(RID_SUBSETSTR_EGYPTIAN_HIEROGLYPH_FORMAT_CONTROLS) );
1778  break;
1779  case UBLOCK_ELYMAIC:
1780  aAllSubsets.emplace_back( 0x10FE0, 0x10FFF, SvxResId(RID_SUBSETSTR_ELYMAIC) );
1781  break;
1782  case UBLOCK_NANDINAGARI:
1783  aAllSubsets.emplace_back( 0x119A0, 0x119FF, SvxResId(RID_SUBSETSTR_NANDINAGARI) );
1784  break;
1785  case UBLOCK_NYIAKENG_PUACHUE_HMONG:
1786  aAllSubsets.emplace_back( 0x1E100, 0x1E14F, SvxResId(RID_SUBSETSTR_NYIAKENG_PUACHUE_HMONG) );
1787  break;
1788  case UBLOCK_OTTOMAN_SIYAQ_NUMBERS:
1789  aAllSubsets.emplace_back( 0x1ED00, 0x1ED4F, SvxResId(RID_SUBSETSTR_OTTOMAN_SIYAQ_NUMBERS) );
1790  break;
1791  case UBLOCK_SMALL_KANA_EXTENSION:
1792  aAllSubsets.emplace_back( 0x1B130, 0x1B16F, SvxResId(RID_SUBSETSTR_SMALL_KANA_EXTENSION) );
1793  break;
1794  case UBLOCK_SYMBOLS_AND_PICTOGRAPHS_EXTENDED_A:
1795  aAllSubsets.emplace_back( 0x1FA70, 0x1FAFF, SvxResId(RID_SUBSETSTR_SYMBOLS_AND_PICTOGRAPHS_EXTENDED_A) );
1796  break;
1797  case UBLOCK_TAMIL_SUPPLEMENT:
1798  aAllSubsets.emplace_back( 0x11FC0, 0x11FFF, SvxResId(RID_SUBSETSTR_TAMIL_SUPPLEMENT) );
1799  break;
1800  case UBLOCK_WANCHO:
1801  aAllSubsets.emplace_back( 0x1E2C0, 0x1E2FF, SvxResId(RID_SUBSETSTR_WANCHO) );
1802  break;
1803 #endif
1804 
1805  }
1806 
1807 #if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
1808  if (eBlock != UBLOCK_NO_BLOCK &&
1809  eBlock != UBLOCK_INVALID_CODE &&
1810  eBlock != UBLOCK_COUNT &&
1811  eBlock != UBLOCK_HIGH_SURROGATES &&
1812  eBlock != UBLOCK_HIGH_PRIVATE_USE_SURROGATES &&
1813  eBlock != UBLOCK_LOW_SURROGATES)
1814 
1815  {
1816  UBlockCode eBlockStart = ublock_getCode(aAllSubsets.back().GetRangeMin());
1817  UBlockCode eBlockEnd = ublock_getCode(aAllSubsets.back().GetRangeMax());
1818  assert(eBlockStart == eBlockEnd && eBlockStart == eBlock);
1819  }
1820 #endif
1821  }
1822 
1823  std::stable_sort(aAllSubsets.begin(), aAllSubsets.end());
1824  return aAllSubsets;
1825  }();
1826 
1827  maSubsets = s_aAllSubsets;
1828 }
1829 
1830 void SubsetMap::ApplyCharMap( const FontCharMapRef& rxFontCharMap )
1831 {
1832  if( !rxFontCharMap.is() )
1833  return;
1834 
1835  // remove subsets that are not matched in any range
1836  maSubsets.erase(std::remove_if(maSubsets.begin(), maSubsets.end(),
1837  [&rxFontCharMap](const Subset& rSubset) {
1838  sal_uInt32 cMin = rSubset.GetRangeMin();
1839  sal_uInt32 cMax = rSubset.GetRangeMax();
1840  int nCount = rxFontCharMap->CountCharsInRange( cMin, cMax );
1841  return nCount <= 0;
1842  }),
1843  maSubsets.end());
1844 }
1845 
1846 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long Width() const
bool is() const
const Color & GetTextColor() const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, MetricVector *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
const Color & GetShadowColor() const
Link< SvxShowCharSet *, void > aHighHdl
Definition: charmap.hxx:124
long GetWidth() const
bool GetFontCharMap(FontCharMapRef &rxFontCharMap) const
ItemsMap m_aItems
Definition: charmap.hxx:120
sal_Int32 nIndex
static sal_uInt16 GetRowPos(sal_uInt16 _nPos)
Definition: charmap.cxx:192
void SetFontSize(const Size &)
VclPtr< VirtualDevice > mxVirDev
Definition: charmap.hxx:58
virtual svx::SvxShowCharSetItem * ImplGetItem(int _nPos)
Definition: charmap.cxx:819
const OUString & GetFamilyName() const
::std::vector< Subset > SubsetVec
Definition: ucsubset.hxx:54
long AdjustWidth(long n)
bool mbUpdateForeground
Definition: charmap.hxx:145
void ContextMenuSelect(const OString &rIdent)
Definition: charmap.cxx:241
The table implementation of the vcl control.
Definition: charmapacc.hxx:70
virtual FactoryFunction GetUITestFactory() const override
Definition: charmap.cxx:57
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
Definition: uiobject.cxx:50
SubsetVec maSubsets
Definition: ucsubset.hxx:65
const Color & GetHighlightTextColor() const
std::unique_ptr< weld::ScrolledWindow > mxScrollArea
Definition: charmap.hxx:60
long Height() const
const SubsetVec & GetSubsetMap() const
Definition: charmap.cxx:858
void SetFont(const vcl::Font &rFont)
Definition: charmap.cxx:455
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
virtual bool MouseMove(const MouseEvent &rMEvt) override
Definition: charmap.cxx:168
const Color & GetFaceColor() const
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
void SetWeight(FontWeight)
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: charmap.cxx:79
bool isFavChar(const OUString &sTitle, const OUString &rFont)
Definition: charmap.cxx:210
sal_uInt16 GetCode() const
geometry::RealPoint2D maPosition
Link< SvxShowCharSet *, void > aDoubleClkHdl
Definition: charmap.hxx:121
Subset(sal_UCS4 nMin, sal_UCS4 nMax, const OUString &rName)
Definition: charmap.cxx:871
constexpr sal_uInt16 KEY_SPACE
tools::Rectangle getGridRectangle(const Point &rPointUL, const Size &rOutputSize)
Definition: charmap.cxx:468
float x
sal_Int32 nSelectedIndex
Definition: charmap.hxx:138
long AdjustHeight(long n)
WEIGHT_LIGHT
FontCharMapRef mxFontCharMap
Definition: charmap.hxx:140
const Color & GetFieldTextColor() const
constexpr sal_uInt16 KEY_UP
Point maPosition
Definition: charmap.hxx:142
const Color & GetHighlightColor() const
Size const & GetOutputSizePixel() const
bool GetTextBoundRect(tools::Rectangle &rRect, const OUString &rStr, sal_Int32 nBase=0, sal_Int32 nIndex=0, sal_Int32 nLen=-1, sal_uLong nLayoutWidth=0, const long *pDXArray=nullptr, const SalLayoutGlyphs *pGlyphs=nullptr) const
constexpr sal_uInt16 KEY_END
bool IsEmpty() const
virtual void GetFocus() override
Definition: charmap.cxx:112
std::deque< OUString > maFavCharFontList
Definition: charmap.hxx:128
sal_uInt16 GetClicks() const
DstType sequenceToContainer(const css::uno::Sequence< SrcType > &i_Sequence)
void SetBackground()
long Right() const
vcl::Font maFont
Definition: charmap.hxx:59
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:28
void setX(long nX)
virtual sal_Int32 getMaxCharCount() const
Definition: charmap.cxx:838
virtual sal_UCS4 GetSelectCharacter() const
Definition: charmap.cxx:635
const vcl::Font & GetFont() const
static sal_uInt32 & getSelectedChar()
Definition: charmap.cxx:51
int nCount
constexpr sal_uInt16 KEY_PAGEUP
const Color & GetLightColor() const
sal_UCS4 GetPrevChar(sal_UCS4 cChar) const
static std::shared_ptr< ConfigurationChanges > create(css::uno::Reference< css::uno::XComponentContext > const &context=comphelper::getProcessComponentContext())
sal_uInt16 GetModifier() const
int PixelToMapIndex(const Point &) const
Definition: charmap.cxx:373
long Top() const
void init()
Definition: charmap.cxx:94
int GetCharCount() const
void setY(long nY)
void DrawLine(const Point &rStartPt, const Point &rEndPt)
virtual void RecalculateFont(vcl::RenderContext &rRenderContext)
Definition: charmap.cxx:643
SvxShowCharSet(std::unique_ptr< weld::ScrolledWindow > pScrollArea, const VclPtr< VirtualDevice > &rVirDev)
Definition: charmap.cxx:62
void DrawRect(const tools::Rectangle &rRect)
IMPL_LINK_NOARG(SvxShowCharSet, VscrollHdl, weld::ScrolledWindow &, void)
Definition: charmap.cxx:778
virtual ~SvxShowCharSet() override
Definition: charmap.cxx:802
float y
constexpr sal_uInt16 KEY_DOWN
void SetAlignment(FontAlign)
void SetLineColor()
bool mbRecalculateFont
Definition: charmap.hxx:144
std::deque< OUString > maFavCharList
Definition: charmap.hxx:127
virtual void Resize() override
Definition: charmap.cxx:107
uno_Any a
virtual void SelectIndex(int index, bool bFocus=false)
Definition: charmap.cxx:684
rtl::Reference< SvxShowCharSetItemAcc > m_xItem
Definition: charmapacc.hxx:51
void DeSelect()
Definition: charmap.cxx:462
int CountCharsInRange(sal_UCS4 cMin, sal_UCS4 cMax) const
constexpr sal_uInt16 KEY_HOME
virtual void DrawChars_Impl(vcl::RenderContext &rRenderContext, int n1, int n2)
Definition: charmap.cxx:498
static sal_uInt16 GetColumnPos(sal_uInt16 _nPos)
Definition: charmap.cxx:344
int i
uno::Reference< uno::XComponentContext > mxContext
Definition: charmap.hxx:131
void SetFillColor()
const Color & GetLineColor() const
void SetTextColor(const Color &rColor)
long Bottom() const
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: charmap.cxx:448
constexpr sal_uInt16 KEY_PAGEDOWN
bool IsInside(const Point &rPOINT) const
virtual int LastInView() const
Definition: charmap.cxx:354
virtual bool KeyInput(const KeyEvent &) override
Definition: charmap.cxx:379
const AllSettings & GetSettings() const
FontCharMapRef const & GetFontCharMap()
Definition: charmap.cxx:843
virtual void LoseFocus() override
Definition: charmap.cxx:117
void SelectCharacter(sal_UCS4 cNew)
Definition: charmap.cxx:763
long GetTextHeight() const
long X() const
constexpr sal_uInt16 KEY_RETURN
int FirstInView() const
Definition: charmap.cxx:349
constexpr sal_uInt16 KEY_RIGHT
Point PixelToLogic(const Point &rDevicePt) const
css::uno::Reference< css::accessibility::XAccessible > GetAccessible()
Definition: charmapacc.cxx:58
sal_UCS4 GetNextChar(sal_UCS4 cChar) const
const vcl::KeyCode & GetKeyCode() const
ALIGN_TOP
Link< SvxShowCharSet *, void > aSelectHdl
Definition: charmap.hxx:122
weld::DrawingArea * GetDrawingArea() const
void InitSettings(vcl::RenderContext &rRenderContext)
Definition: charmap.cxx:610
static void CopyToClipboard(const OUString &str)
Definition: charmap.cxx:257
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
Definition: charmap.cxx:154
rtl::Reference< svx::SvxShowCharSetAcc > m_xAccessible
Definition: charmap.hxx:130
constexpr sal_uInt16 KEY_ESCAPE
void updateFavCharacterList(const OUString &rChar, const OUString &rFont)
Definition: charmap.cxx:280
void SetFont(const vcl::Font &rNewFont)
void SetTransparent(bool bTransparent)
bool IsLeft() const
sal_Unicode GetCharCode() const
#define COLUMN_COUNT
Definition: charmap.hxx:46
virtual int get_text_height() const =0
SVX_DLLPRIVATE void InitList()
Definition: charmap.cxx:876
Reference< XComponentContext > getProcessComponentContext()
const Color & GetWindowColor() const
const Point & GetPosPixel() const
long Left() const
sal_UCS4 GetCharFromIndex(int nCharIndex) const
long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override
Definition: charmap.cxx:812
Simple struct to hold some information about the single items of the table.
Definition: charmapacc.hxx:45
Link< SvxShowCharSet *, void > aFavClickHdl
Definition: charmap.hxx:123
static weld::Builder * CreateBuilder(weld::Widget *pParent, const OUString &rUIFile)
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
Definition: charmap.cxx:122
sal_uInt32 sal_UCS4
bool IsRight() const
constexpr sal_uInt16 KEY_LEFT
const Subset * GetSubsetByUnicode(sal_UCS4) const
Definition: charmap.cxx:863
void getFavCharacterList()
Definition: charmap.cxx:197
const Color & GetDialogTextColor() const
SVX_DLLPRIVATE void ApplyCharMap(const FontCharMapRef &)
Definition: charmap.cxx:1830
Point MapIndexToPixel(int) const
Definition: charmap.cxx:364
void OutputIndex(int index)
Definition: charmap.cxx:756
int GetIndexFromChar(sal_UCS4 cChar) const
void createContextMenu()
Definition: charmap.cxx:224
SubsetMap(const FontCharMapRef &)
Definition: charmap.cxx:852
Reference< XComponentContext > mxContext
virtual float get_approximate_digit_width() const =0
long Y() const
const Color & GetFillColor() const
constexpr sal_uInt16 KEY_TAB
Link< SvxShowCharSet *, void > aPreSelectHdl
Definition: charmap.hxx:125
#define ROW_COUNT
Definition: charmap.hxx:47
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)
bool mbUpdateBackground
Definition: charmap.hxx:146