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