LayoutMenu.cxx (8dcb2a10) LayoutMenu.cxx (65be1ea2)
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

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

334 nMinimumWidth = aItemSize.Width();
335 }
336 return nMinimumWidth;
337}
338
339
340
341
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

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

334 nMinimumWidth = aItemSize.Width();
335 }
336 return nMinimumWidth;
337}
338
339
340
341
342void LayoutMenu::UpdateEnabledState (const MasterMode eMode)
343{
344 bool bIsEnabled (false);
345
346 ::boost::shared_ptr<ViewShell> pMainViewShell (mrBase.GetMainViewShell());
347 if (pMainViewShell)
348 {
349 switch (pMainViewShell->GetShellType())
350 {
351 case ViewShell::ST_NONE:
352 case ViewShell::ST_OUTLINE:
353 case ViewShell::ST_PRESENTATION:
354 case ViewShell::ST_SIDEBAR:
355 // The complete task pane is disabled for these values or
356 // not even visible. Disabling the LayoutMenu would be
357 // logical but unnecessary. The main disadvantage is that
358 // after re-enabling it (typically) another panel is
359 // expanded.
360 bIsEnabled = true;
361 break;
362
363 case ViewShell::ST_DRAW:
364 case ViewShell::ST_IMPRESS:
365 {
366 switch (eMode)
367 {
368 case MM_UNKNOWN:
369 {
370 ::boost::shared_ptr<DrawViewShell> pDrawViewShell (
371 ::boost::dynamic_pointer_cast<DrawViewShell>(pMainViewShell));
372 if (pDrawViewShell)
373 bIsEnabled = pDrawViewShell->GetEditMode() != EM_MASTERPAGE;
374 break;
375 }
376 case MM_NORMAL:
377 bIsEnabled = true;
378 break;
379
380 case MM_MASTER:
381 bIsEnabled = false;
382 break;
383 }
384 break;
385 }
386
387 case ViewShell::ST_HANDOUT:
388 case ViewShell::ST_NOTES:
389 case ViewShell::ST_SLIDE_SORTER:
390 default:
391 bIsEnabled = true;
392 break;
393 }
394 }
395}
396
397
398
399
400void LayoutMenu::Paint (const Rectangle& rRect)
401{
402 if (mbSelectionUpdatePending)
403 {
404 mbSelectionUpdatePending = false;
405 UpdateSelection();
406 }
407 ValueSet::Paint (rRect);

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

901 case ::sd::tools::EventMultiplexerEvent::EID_CURRENT_PAGE:
902 case ::sd::tools::EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION:
903 if ( ! mbSelectionUpdatePending)
904 UpdateSelection();
905 break;
906
907 case ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED:
908 mbIsMainViewChangePending = true;
342void LayoutMenu::Paint (const Rectangle& rRect)
343{
344 if (mbSelectionUpdatePending)
345 {
346 mbSelectionUpdatePending = false;
347 UpdateSelection();
348 }
349 ValueSet::Paint (rRect);

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

843 case ::sd::tools::EventMultiplexerEvent::EID_CURRENT_PAGE:
844 case ::sd::tools::EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION:
845 if ( ! mbSelectionUpdatePending)
846 UpdateSelection();
847 break;
848
849 case ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED:
850 mbIsMainViewChangePending = true;
909 UpdateEnabledState(MM_UNKNOWN);
910 break;
911
912 case ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED:
913 HideFocus();
914 break;
915
916 case ::sd::tools::EventMultiplexerEvent::EID_CONFIGURATION_UPDATED:
917 if (mbIsMainViewChangePending)
918 {
919 mbIsMainViewChangePending = false;
920 InvalidateContent();
921 }
922 break;
923
851 break;
852
853 case ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED:
854 HideFocus();
855 break;
856
857 case ::sd::tools::EventMultiplexerEvent::EID_CONFIGURATION_UPDATED:
858 if (mbIsMainViewChangePending)
859 {
860 mbIsMainViewChangePending = false;
861 InvalidateContent();
862 }
863 break;
864
924 case ::sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL:
925 UpdateEnabledState(MM_NORMAL);
926 break;
927
928 case ::sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER:
929 UpdateEnabledState(MM_MASTER);
930 break;
931
932 default:
933 /* Ignored */
934 break;
935 }
936
937 return 0;
938}
939

--- 45 unchanged lines hidden ---
865 default:
866 /* Ignored */
867 break;
868 }
869
870 return 0;
871}
872

--- 45 unchanged lines hidden ---