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