Author: mlytwyn
Date: Wed Jul  1 21:40:11 2015
New Revision: 38731

URL: http://svn.gna.org/viewcvs/gnustep?rev=38731&view=rev
Log:
Merge Source/NSMenu.m - reformat Source/NSLayoutManager.m

Modified:
    libs/gui/branches/gnustep_testplant_branch/Source/NSLayoutManager.m
    libs/gui/branches/gnustep_testplant_branch/Source/NSMenu.m

Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSLayoutManager.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSLayoutManager.m?rev=38731&r1=38730&r2=38731&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSLayoutManager.m 
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSLayoutManager.m Wed Jul 
 1 21:40:11 2015
@@ -883,35 +883,37 @@
       glyph_index = [self numberOfGlyphs] - 1;
       if (glyph_index == (unsigned int)-1)
         { /* No information is available. Get default font height. */
-          NSFont            *f         = [_typingAttributes 
objectForKey:NSFontAttributeName];
+          NSFont *f = [_typingAttributes objectForKey:NSFontAttributeName];
           
           /* will be -1 if there are no text containers */
           *textContainer = num_textcontainers - 1;
           r = NSMakeRect(0, 0, 1, [f boundingRectForFont].size.height);
           if (num_textcontainers > 0)
-          {
+            {
               NSParagraphStyle *paragraph = [_typingAttributes objectForKey: 
NSParagraphStyleAttributeName];
-              NSTextAlignment alignment = [paragraph alignment];
-
-            tc = textcontainers + num_textcontainers - 1;
-            r.origin.x += [tc->textContainer lineFragmentPadding];
-          
-          // Apply left/right/center justification...
-          if (alignment == NSRightTextAlignment)
-          {
+              NSTextAlignment   alignment = [paragraph alignment];
+              
+              tc = textcontainers + num_textcontainers - 1;
+              r.origin.x += [tc->textContainer lineFragmentPadding];
+              
+              // Apply left/right/center justification...
+              if (alignment == NSRightTextAlignment)
+                {
                   r.origin.x += [tc->textContainer containerSize].width;
-          }
-          else if (alignment == NSCenterTextAlignment)
-          {
+                }
+              else if (alignment == NSCenterTextAlignment)
+                {
                   r.origin.x += [tc->textContainer containerSize].width / 2;
-          }
-           }
+                }
+            }
           return r;
         }
       fraction_through = 1.0;
     }
   else
-    [self _doLayoutToGlyph: glyph_index];
+    {
+      [self _doLayoutToGlyph: glyph_index];
+    }
   
   for (tc = textcontainers, i = 0; i < num_textcontainers; i++, tc++)
     if (tc->pos + tc->length > glyph_index)

Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSMenu.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSMenu.m?rev=38731&r1=38730&r2=38731&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSMenu.m  (original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSMenu.m  Wed Jul  1 
21:40:11 2015
@@ -503,7 +503,8 @@
       
       if ((_aWindow != nil) && ([_aWindow screen] != nil))
         {
-          origin = NSMakePoint(0, [[_aWindow screen] visibleFrame].size.height 
- [_aWindow frame].size.height);
+          origin = NSMakePoint(0, [[_aWindow screen] visibleFrame].size.height 
+                               - [_aWindow frame].size.height);
          
           [_aWindow setFrameOrigin: origin];
           [_bWindow setFrameOrigin: origin];
@@ -831,6 +832,7 @@
   [self menuChanged];
 }
 
+  // Testplant-MAL-2015-07-01: Using testplant branch code...
 - (void) removeAllItems
 {
   [_items makeObjectsPerformSelector:@selector(setMenu:) withObject:nil];
@@ -902,7 +904,7 @@
   return nil;
 }
 
-- (id <NSMenuItem>) itemAtIndex: (NSInteger)index
+- (NSMenuItem *) itemAtIndex: (NSInteger)index
 {
   if (index >= [_items count] || index < 0)
     [NSException  raise: NSRangeException
@@ -1093,6 +1095,7 @@
 
 - (void) update
 {
+  // Testplant-MAL-2015-07-01: Stop potential recursive invocation...
   if (_menu.isUpdating == NO)
     {
       _menu.isUpdating = YES;
@@ -1243,6 +1246,7 @@
         }
       }
       
+      // Testplant-MAL-2015-07-01: Stop potential recursive invocation...
       _menu.isUpdating = NO;
     }
   
@@ -1508,6 +1512,7 @@
   return _menu.changedMessagesEnabled;
 }
 
+  // Testplant-MAL-2015-07-01: Using testplant branch code...
 - (NSSize) size
 {
   if (_view)
@@ -1585,10 +1590,10 @@
                   forView: (NSView *)view
                  withFont: (NSFont *)font
 {
+  // Testplant-MAL-2015-07-01: Using tetplant branch code...
   NSPoint point = [view frame].origin;
   point = [[view superview] convertPoint:point toView:nil];
-      point = [[view window] convertBaseToScreen: point];
-//  [[menu window] setFrameOrigin:point];
+  point = [[view window] convertBaseToScreen: point];
   [menu _rightMouseDisplay: event];
 }
 


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to