ResourceManager.cxx (e56b0a16) ResourceManager.cxx (85f1aca2)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 398 unchanged lines hidden (view full) ---

407 : sValue.getToken(0, ',', nCharacterIndex).trim());
408 const OUString sMenuCommand (
409 sMenuCommandOverride.getLength()>0
410 ? (sMenuCommandOverride.equalsAscii("none")
411 ? OUString()
412 : sMenuCommandOverride)
413 : rsDefaultMenuCommand);
414
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 398 unchanged lines hidden (view full) ---

407 : sValue.getToken(0, ',', nCharacterIndex).trim());
408 const OUString sMenuCommand (
409 sMenuCommandOverride.getLength()>0
410 ? (sMenuCommandOverride.equalsAscii("none")
411 ? OUString()
412 : sMenuCommandOverride)
413 : rsDefaultMenuCommand);
414
415 // Setup a list of application enums. Note that the
416 // application name may result in more than one value (eg
417 // DrawImpress will result in two enums, one for Draw and one
418 // for Impress).
419 ::std::vector<EnumContext::Application> aApplications;
415 EnumContext::Application eApplication (EnumContext::GetApplicationEnum(sApplicationName));
420 EnumContext::Application eApplication (EnumContext::GetApplicationEnum(sApplicationName));
416 EnumContext::Application eApplication2 (EnumContext::Application_None);
417 if (eApplication == EnumContext::Application_None
418 && !sApplicationName.equals(EnumContext::GetApplicationName(EnumContext::Application_None)))
419 {
420 // Handle some special names: abbreviations that make
421 // context descriptions more readable.
422 if (sApplicationName.equalsAscii("Writer"))
421 if (eApplication == EnumContext::Application_None
422 && !sApplicationName.equals(EnumContext::GetApplicationName(EnumContext::Application_None)))
423 {
424 // Handle some special names: abbreviations that make
425 // context descriptions more readable.
426 if (sApplicationName.equalsAscii("Writer"))
423 eApplication = EnumContext::Application_Writer;
427 aApplications.push_back(EnumContext::Application_Writer);
424 else if (sApplicationName.equalsAscii("Calc"))
428 else if (sApplicationName.equalsAscii("Calc"))
425 eApplication = EnumContext::Application_Calc;
429 aApplications.push_back(EnumContext::Application_Calc);
426 else if (sApplicationName.equalsAscii("Draw"))
430 else if (sApplicationName.equalsAscii("Draw"))
427 eApplication = EnumContext::Application_Draw;
431 aApplications.push_back(EnumContext::Application_Draw);
428 else if (sApplicationName.equalsAscii("Impress"))
432 else if (sApplicationName.equalsAscii("Impress"))
429 eApplication = EnumContext::Application_Impress;
433 aApplications.push_back(EnumContext::Application_Impress);
430 else if (sApplicationName.equalsAscii("DrawImpress"))
431 {
432 // A special case among the special names: it is
433 // common to use the same context descriptions for
434 // both Draw and Impress. This special case helps to
435 // avoid duplication in the .xcu file.
434 else if (sApplicationName.equalsAscii("DrawImpress"))
435 {
436 // A special case among the special names: it is
437 // common to use the same context descriptions for
438 // both Draw and Impress. This special case helps to
439 // avoid duplication in the .xcu file.
436 eApplication = EnumContext::Application_Draw;
437 eApplication2 = EnumContext::Application_Impress;
440 aApplications.push_back(EnumContext::Application_Draw);
441 aApplications.push_back(EnumContext::Application_Impress);
438 }
442 }
439 else if (sApplicationName.equalsAscii("WriterAndWeb"))
443 else if (sApplicationName.equalsAscii("WriterVariants"))
440 {
444 {
441 // Another special case for Writer and WriterWeb.
442 eApplication = EnumContext::Application_Writer;
443 eApplication2 = EnumContext::Application_WriterWeb;
445 // Another special case for all Writer variants.
446 aApplications.push_back(EnumContext::Application_Writer);
447 aApplications.push_back(EnumContext::Application_WriterGlobal);
448 aApplications.push_back(EnumContext::Application_WriterWeb);
449 aApplications.push_back(EnumContext::Application_WriterXML);
444 }
445 else
446 {
447 OSL_ASSERT("application name not recognized");
448 continue;
449 }
450 }
450 }
451 else
452 {
453 OSL_ASSERT("application name not recognized");
454 continue;
455 }
456 }
451
457 else
458 {
459 // No conversion of the application name necessary.
460 aApplications.push_back(eApplication);
461 }
462
463 // Setup the actual context enum.
452 const EnumContext::Context eContext (EnumContext::GetContextEnum(sContextName));
453 if (eContext == EnumContext::Context_Unknown)
454 {
455 OSL_ASSERT("context name not recognized");
456 continue;
457 }
458
464 const EnumContext::Context eContext (EnumContext::GetContextEnum(sContextName));
465 if (eContext == EnumContext::Context_Unknown)
466 {
467 OSL_ASSERT("context name not recognized");
468 continue;
469 }
470
471 // Setup the flag that controls whether a deck/pane is
472 // initially visible/expanded.
459 bool bIsInitiallyVisible;
460 if (sInitialState.equalsAscii("visible"))
461 bIsInitiallyVisible = true;
462 else if (sInitialState.equalsAscii("hidden"))
463 bIsInitiallyVisible = false;
464 else
465 {
466 OSL_ASSERT("unrecognized state");
467 continue;
468 }
469
473 bool bIsInitiallyVisible;
474 if (sInitialState.equalsAscii("visible"))
475 bIsInitiallyVisible = true;
476 else if (sInitialState.equalsAscii("hidden"))
477 bIsInitiallyVisible = false;
478 else
479 {
480 OSL_ASSERT("unrecognized state");
481 continue;
482 }
483
470 if (eApplication != EnumContext::Application_None)
471 rContextList.AddContextDescription(
472 Context(
473 EnumContext::GetApplicationName(eApplication),
474 EnumContext::GetContextName(eContext)),
475 bIsInitiallyVisible,
476 sMenuCommand);
477 if (eApplication2 != EnumContext::Application_None)
478 rContextList.AddContextDescription(
479 Context(
480 EnumContext::GetApplicationName(eApplication2),
481 EnumContext::GetContextName(eContext)),
482 bIsInitiallyVisible,
483 sMenuCommand);
484 // Add context descriptors.
485 for (::std::vector<EnumContext::Application>::const_iterator
486 iApplication(aApplications.begin()),
487 iEnd(aApplications.end());
488 iApplication!=iEnd;
489 ++iApplication)
490 {
491 if (*iApplication != EnumContext::Application_None)
492 rContextList.AddContextDescription(
493 Context(
494 EnumContext::GetApplicationName(*iApplication),
495 EnumContext::GetContextName(eContext)),
496 bIsInitiallyVisible,
497 sMenuCommand);
498 }
484 }
485}
486
487
488
489
490void ResourceManager::ReadLegacyAddons (const Reference<frame::XFrame>& rxFrame)
491{

--- 140 unchanged lines hidden ---
499 }
500}
501
502
503
504
505void ResourceManager::ReadLegacyAddons (const Reference<frame::XFrame>& rxFrame)
506{

--- 140 unchanged lines hidden ---